puppeteer/.github/workflows/unit.yml
Nikolay Vitkov 9d2b65912b
ci: split jobs (#11343)
Co-authored-by: jrandolf <101637635+jrandolf@users.noreply.github.com>
2023-11-10 14:45:37 +01:00

68 lines
2.0 KiB
YAML

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