name: CI on: pull_request: push: branches: [main] permissions: contents: read concurrency: group: ci-${{ github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: check: name: Checks (${{ matrix.os }}) runs-on: ${{ matrix.os }} timeout-minutes: 15 strategy: fail-fast: false matrix: os: [macos-latest, ubuntu-latest] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version-file: .node-version cache: npm - run: npm ci - run: npm run format:check - run: npm run lint - run: npm run typecheck - run: npm run test:unit - run: npm run build - run: npm pack --dry-run integration: name: Integration tests (${{ matrix.os }}, ${{ matrix.shard }}/3) # The tests drive a headed Chrome. Linux runs it in Xvfb because GitHub runners have no desktop session. # Each shard gets its own runner, so the Chromes never compete for one machine's CPU. runs-on: ${{ matrix.os }} timeout-minutes: 20 strategy: fail-fast: false matrix: os: [macos-latest, ubuntu-latest] shard: [1, 2, 3] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version-file: .node-version cache: npm - run: npm ci - if: runner.os == 'macOS' run: npm run test:integration -- --shard=${{ matrix.shard }}/3 - if: runner.os == 'Linux' run: xvfb-run -a npm run test:integration -- --shard=${{ matrix.shard }}/3 secrets: name: Secret scan runs-on: ubuntu-latest timeout-minutes: 5 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 # The gitleaks GitHub Action needs a paid license for organization repos; the container does not. - run: docker run --rm -v "$PWD:/repo" ghcr.io/gitleaks/gitleaks:v8.30.1 git /repo --no-banner --redact -v