📝 Add a "simple" example #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Poltergust Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build-and-test-valid-examples: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
- name: Install poltergust | |
run: npm ci | |
- name: Run the simple example | |
run: npx poltergust ./examples/simple | |
- name: Run the complex example | |
run: npx poltergust ./examples/complex | |
- name: Commit aggregated rulesets | |
run: | | |
git config --global user.name '👻poltergust' | |
git config --global user.email '[email protected]' | |
git diff --quiet || ( git commit -am "👻 Auto-update valid ruleset" && git push) | |
build-and-test-invalid-example: | |
needs: build-and-test-valid-examples | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
- name: Install poltergust | |
run: npm ci | |
- name: Run the invalid example (should exit 1) | |
run: npx poltergust ./examples/invalid || (exitcode=$?; [ $exitcode -eq 1 ] || exit $exitcode) | |
shell: bash |