Skip to content

chore: split installation and build #76

chore: split installation and build

chore: split installation and build #76

Workflow file for this run

name: Tests
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
install:
name: 'install'
runs-on: ubuntu-latest
outputs:
integration-matrix: ${{ steps.discover.outputs.integration }}
e2e-matrix: ${{ steps.discover.outputs.e2e }}
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.1
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Cache dependencies
id: dependencies-cache
uses: actions/cache@v4
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-deps-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install dependencies
if: steps.dependencies-cache.outputs.cache-hit != 'true'
run: pnpm install
- name: Discover test packages
id: discover
run: node --experimental-strip-types .github/scripts/discover-test-packages.ts
build:
needs: [install]
name: 'build'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.1
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Restore dependencies
uses: actions/cache@v4
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-deps-${{ hashFiles('pnpm-lock.yaml') }}
- name: Cache build outputs
id: build-cache
uses: actions/cache@v4
with:
path: |
packages/*/dist
apps/*/dist
key: ${{ runner.os }}-build-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'apps/**') }}
- name: Run build
if: steps.build-cache.outputs.cache-hit != 'true'
run: pnpm run build
lint:
needs: [install]
name: 'lint'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.1
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Restore dependencies
uses: actions/cache@v4
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-deps-${{ hashFiles('pnpm-lock.yaml') }}
- name: Run linting
run: pnpm run lint
typescript:
needs: [build]
name: 'typescript'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.1
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Restore dependencies
uses: actions/cache@v4
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-deps-${{ hashFiles('pnpm-lock.yaml') }}
- name: Restore build outputs
uses: actions/cache@v4
with:
path: |
packages/*/dist
apps/*/dist
key: ${{ runner.os }}-build-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'apps/**') }}
- name: Run TypeScript checks
run: pnpm run check-types
test-integration:
needs: [install, build, lint, typescript]
name: 'test:integration (${{ matrix.name }})'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.install.outputs.integration-matrix) }}
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.1
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Restore dependencies
uses: actions/cache@v4
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-deps-${{ hashFiles('pnpm-lock.yaml') }}
- name: Restore build outputs
uses: actions/cache@v4
with:
path: |
packages/*/dist
apps/*/dist
key: ${{ runner.os }}-build-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'apps/**') }}
- name: Run integration tests
run: pnpm --filter='${{ matrix.package }}' run test:integration
test-e2e:
needs: [install, build, lint, typescript]
name: 'test:e2e (${{ matrix.name }})'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.install.outputs.e2e-matrix) }}
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.1
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Restore dependencies
uses: actions/cache@v4
with:
path: |
node_modules
apps/*/node_modules
packages/*/node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-deps-${{ hashFiles('pnpm-lock.yaml') }}
- name: Restore build outputs
uses: actions/cache@v4
with:
path: |
packages/*/dist
apps/*/dist
key: ${{ runner.os }}-build-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'apps/**') }}
- name: Run e2e tests
run: pnpm --filter='${{ matrix.package }}' run test:e2e
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report-${{ matrix.name }}
path: '**/playwright-report/'
retention-days: 30