name: CI # **What it does**: Runs tests. # **Why we have it**: Ensures tests pass before merging code. on: push: branches: - main paths-ignore: - "docs/**" - "*.md" pull_request: branches: - main paths-ignore: - "docs/**" - "*.md" types: [opened, ready_for_review, reopened, synchronize] # This allows a subsequently queued workflow run to interrupt previous runs concurrency: group: "${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" cancel-in-progress: true permissions: contents: read jobs: code-quality: name: Code Quality uses: fdawgs/workflows/.github/workflows/reusable-code-quality.yml@7e86269d8d77ca42d9fc9ccd6f5f156e98715254 # v2.2.1 permissions: contents: read with: commitlint: true lint: true unit-tests: name: Unit Tests strategy: matrix: node-version: [20, 22, 24, 26] os: [macos-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} permissions: contents: read steps: - name: Check out repo uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Setup Node ${{ matrix.node-version }} uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: check-latest: true node-version: ${{ matrix.node-version }} - name: Install run: npm i --ignore-scripts - name: Run tests run: npm run test:unit:coverage - name: Coveralls parallel if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8 with: github-token: ${{ secrets.GITHUB_TOKEN }} parallel: true flag-name: run-${{ matrix.node-version }}-${{ matrix.os }} coverage: name: Aggregate Coverage Calculations needs: unit-tests if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest permissions: contents: read steps: - name: Coveralls finished uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8 with: github-token: ${{ secrets.GITHUB_TOKEN }} parallel-finished: true automerge: name: Automerge Dependabot PRs needs: [code-quality, unit-tests] if: > github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login == 'dependabot[bot]' runs-on: ubuntu-latest permissions: pull-requests: write contents: write steps: - uses: fastify/github-action-merge-dependabot@73ec4cbb5e56df5591eae286972d5b2201ffe90f # v3.15.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} merge-method: squash