Tests - Caching #464
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
NX_NON_NATIVE_HASHER: true | |
jobs: | |
audit: | |
runs-on: ubuntu-latest | |
name: Audit | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Audit production dependencies | |
run: npm audit --omit=dev --omit=optional | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Set base and head for Nx affected commands | |
uses: nrwl/nx-set-shas@v4 | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint affected projects | |
run: npx nx affected -t lint --parallel=3 --verbose | |
unit-test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] # @TODO add windows-latest after we have the os agnostic macher | |
name: Unit tests | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Set base and head for Nx affected commands | |
uses: nrwl/nx-set-shas@v4 | |
- name: Install dependencies | |
run: npm ci | |
- name: Unit test affected projects | |
run: npx nx affected -t unit-test --parallel=3 --coverage.enabled | |
e2e: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] # @TODO add windows-latest after we know why it is running forever | |
name: E2E tests | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Set base and head for Nx affected commands | |
uses: nrwl/nx-set-shas@v4 | |
- name: Install dependencies | |
run: npm i | |
- name: E2E test affected projects | |
run: npx nx affected -t nxv-e2e --exclude="tag:type:example" --skipNxCache --verbose |