Code Monkey home page Code Monkey logo

parsiphae-action's Introduction

Parsiphae Action

CI Coverage Marketplace

GitHub action for Parsiphae, a WIP compiler for the Daedalus scripting language, written by and maintained by @Lehona.

Checks

Checks are added to commits and performed on pull requests.

Checks page

actions-checks

Commit file and line annotations

commit-checks

Pull request checks

pr-checks

Usage

Create a new GitHub Actions workflow in your project, e.g. at .github/workflows/scripts.yml. The content of the file should be in the following format:

name: scripts

# Trigger workflow on push events with changes in SRC or D files
on:
  push:
    paths:
      - '**.src'
      - '**.d'

# These permissions are necessary for creating the check runs
permissions:
  contents: read
  checks: write

# The checkout action needs to be run first
jobs:
  parsiphae:
    name: Run Parsiphae on scripts
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Check scripts
        uses: szapp/parsiphae-action@v1
        with:
          file: _work/Data/Scripts/Content/Gothic.src
          check-name: # Optional (see below)
          cache: # Optional
          token: # Optional

Configuration

  • file: File path within the repository of the D file or the SRC file to parse, e.g. _work\Data\Scripts\Content\Gothic.src
    Required

  • check-name: Specify a different name for the check run. Useful to differentiate checks if there are multiple instances of this action in one workflow.
    Defaults to 'Parsiphae'

  • cache: Cache the Parsiphae built in between workflow runs. This greatly increases speed of the check as Parsiphae is not cloned and re-built every time. The cached executable is specific to the workflow runner OS and the Parsiphae version.
    Defaults to true

  • token: The GITHUB_TOKEN to authenticate on behalf of GitHub Actions.
    Defaults to the GitHub token, i.e. checks are created by the GitHub Actions bot.

Remove second commit status check

The way GitHub check suites are designed, there will be two check statuses attached to a commit when using the 'push' event trigger. One check status is the actual check run containing the error report and line annotations, the second one is the workflow run. Unfortunately, the creation of the superfluous workflow check status cannot be suppressed.

One workaround is to delete the entire workflow after the checks have been performed, effectively removing the check status from the commit. However, this is not possible with the default GITHUB_TOKEN, to avoid recursive workflow runs. To remove the additional status check, call this GitHub Action with an authentication token of a GitHub App and enable the check_run event with completed (see below). For more details the issue, see here. Always leave the additional input cleanup-token at its default.

Tip

This is only an optional cosmetic enhancement and this GitHub action works fine without.

name: scripts

on:
  push:
    paths:
      - '**.src'
      - '**.d'
  check_run:
    types: completed

permissions:
  contents: read
  checks: write
  actions: write

jobs:
  parsiphae:
    name: Run Parsiphae on scripts
    if: github.event_name != 'check_run' || github.event.check_run.external_id == format('{0}-0', github.workflow)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/create-github-app-token@v1
        id: app-token
        with:
          app-id: ${{ vars.APP_ID }} # GitHub App ID
          private-key: ${{ secrets.APP_KEY }} # GitHub App private key
      - uses: actions/checkout@v4
      - name: Check scripts
        uses: szapp/parsiphae-action@v1
        with:
          file: _work/Data/Scripts/Content/Gothic.src
          check-name: # Optional (see below)
          cache: # Optional
          token: ${{ steps.app-token.outputs.token }}

Note

This procedure only works reasonably well if parsiphae-action is only called once in the workflow file.

parsiphae-action's People

Contributors

szapp avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.