name: Unit tests # Declare default permissions as read only. permissions: read-all on: push: branches: - main pull_request: branches: - '**' concurrency: group: unit-tests-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: check-changes: uses: ./.github/workflows/changed-packages.yml with: check-mergeable-state: true puppeteer: name: '[Required] Puppeteer Unit tests' runs-on: ubuntu-latest needs: check-changes if: ${{ contains(fromJSON(needs.check-changes.outputs.changes), 'puppeteer') }} steps: - name: Check out repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up Node.js uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 with: cache: npm node-version: lts/* # Set up GitHub Actions caching for Wireit. - uses: google/wireit@f3a3c79c553122e2fe5829eeac7d815326502903 # setup-github-actions-caching/v1 - name: Install dependencies run: npm ci env: PUPPETEER_SKIP_DOWNLOAD: true - name: Run unit tests run: | npm run unit -w puppeteer-core -w puppeteer --if-present - name: Tests types run: npm run test-types ng-schematics: name: '[Required] Angular Schematics tests' runs-on: ubuntu-latest needs: check-changes if: ${{ contains(fromJSON(needs.check-changes.outputs.changes), 'ng-schematics') }} steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up Node.js uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 with: cache: npm node-version: lts/* - name: Install dependencies run: npm ci env: PUPPETEER_SKIP_DOWNLOAD: true - name: Run tests run: npm run test -w @puppeteer/ng-schematics