ci: bump setup-node to v4 #204
This file contains hidden or 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: Quint | |
on: | |
# Every pull request | |
pull_request: | |
# When part of a merge queue | |
# See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue#triggering-merge-group-checks-with-github-actions | |
merge_group: | |
# Pushes into the trunk | |
# This is important to ensure the trunk is not broken and | |
# to populate the cache for future PRs. | |
# See https://github.community/t/actions-cache-cache-not-being-hit-despite-of-being-present/17956/3 | |
push: | |
branches: | |
- main | |
jobs: | |
changes: | |
name: Detect changes | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
outputs: | |
quint: ${{ steps.filter.outputs.quint }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
quint: | |
- 'quint/**' | |
format-check: | |
needs: changes | |
if: ${{ needs.changes.outputs.quint == 'true' || github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./quint | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
- run: npm install | |
- run: npm run format-check || (echo "Run 'npm run format'" && exit 1) | |
quint-unit-tests: | |
name: Unit Tests by OS | |
needs: changes | |
if: ${{ needs.changes.outputs.quint == 'true' || github.ref == 'refs/heads/main' }} | |
runs-on: ${{ matrix.operating-system }} | |
defaults: | |
run: | |
working-directory: ./quint | |
strategy: | |
fail-fast: false | |
matrix: | |
operating-system: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
- run: npm install | |
- run: npm run compile | |
- run: npm test | |
quint-unit-tests-aggregator: | |
name: Unit Tests | |
# Needed to aggregate all matrix options under the same name for the requirement | |
needs: quint-unit-tests | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "All OS tests completed successfully!" | |
quint-test-generated-up-to-date: | |
name: Generated files up-to-date | |
needs: changes | |
if: ${{ needs.changes.outputs.quint == 'true' || github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./quint | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
- run: npm install | |
- name: Compile and update test fixtures | |
run: npm run generate | |
- name: Check that generated files are up to date | |
run: | | |
git diff --exit-code \ | |
|| ( echo ">>> ERROR: Generated files are not up to date. Run 'npm run generate'" && exit 1) |