Sync from commercial #4
Workflow file for this run
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: "🔍 Tests PR" | |
| on: | |
| pull_request: | |
| branches: [main] | |
| merge_group: | |
| workflow_dispatch: | |
| concurrency: | |
| group: | |
| ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| linting: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v3 | |
| - name: node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| cache: "npm" | |
| - name: install dependencies | |
| run: npm ci | |
| - name: install clang-tidy | |
| run: sudo apt-get install -y clang-tidy | |
| - name: build project | |
| # Build project so that imports can be checked during linting | |
| run: npm run build | |
| - name: build fuzzer | |
| # Build the native addon so that CMake downloads libFuzzer and | |
| # generates compile_commands.json, which are needed by clang-tidy | |
| run: npm run build --workspace=@jazzer.js/fuzzer | |
| - name: check formatting and linting | |
| run: npm run check | |
| tests: | |
| name: unit tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [windows-latest, ubuntu-latest, macos-latest] | |
| # Test only latest LTS version in PRs | |
| node: [20] | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v3 | |
| - uses: actions/cache@v3 | |
| id: cache-fuzzer | |
| with: | |
| path: | | |
| packages/fuzzer/prebuilds | |
| key: | |
| fuzzer-cache-${{ matrix.os }}-${{ | |
| hashFiles('packages/fuzzer/CMakeLists.txt', | |
| 'packages/fuzzer/**/*.h', 'packages/fuzzer/**/*.cpp') }} | |
| - name: node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: "npm" | |
| - name: MSVC (windows) | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| if: contains(matrix.os, 'windows') | |
| - name: install dependencies | |
| run: npm ci | |
| - name: build project | |
| run: npm run build | |
| - name: build fuzzer | |
| if: ${{ steps.cache-fuzzer.outputs.cache-hit != 'true' }} | |
| run: npm run build --workspace=@jazzer.js/fuzzer | |
| - name: run all tests | |
| run: npm run test | |
| auto-merge: | |
| needs: | |
| - linting | |
| - tests | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| runs-on: ubuntu-latest | |
| if: ${{ github.actor == 'dependabot[bot]' }} | |
| steps: | |
| - name: Dependabot metadata | |
| id: metadata | |
| uses: dependabot/fetch-metadata@v1.3.6 | |
| with: | |
| github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: Approve | |
| if: | |
| ${{steps.metadata.outputs.update-type != | |
| 'version-update:semver-major'}} | |
| run: gh pr review --approve "$PR_URL" | |
| env: | |
| PR_URL: ${{github.event.pull_request.html_url}} | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Enable auto-merge | |
| if: | |
| ${{steps.metadata.outputs.update-type != | |
| 'version-update:semver-major'}} | |
| run: gh pr merge --auto --rebase "$PR_URL" | |
| env: | |
| PR_URL: ${{github.event.pull_request.html_url}} | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |