# This workflow will run unit tests for the current project name: Unit Tests permissions: contents: read on: push: branches: ["main"] paths: - "apps/web/**" - "packages/shared/**" - "*" - ".*" pull_request: paths: - "apps/web/**" - "packages/shared/**" - "*" - ".*" workflow_dispatch: # Allows triggering the workflow manually in GitHub UI # If another push to the same PR or branch happens while this workflow is still running, # cancel the earlier run in favor of the next run. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: unit-tests: name: Unit Tests strategy: matrix: os: [ubuntu-latest] node-version: [18.x, 20.x] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Enable Corepack run: corepack enable - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: "yarn" - name: Install dependencies run: yarn install --immutable --mode=skip-build - name: Build project run: yarn build - name: Run tests run: yarn test