.github/workflows/ci.yml
name: CI
on:
push:
branches: [main, dev]
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
# containers must run in Linux based operating systems
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v3
with:
# This allows yarn workspaces --since to compare with origin/main branch
fetch-depth: 0
- name: โ๏ธ Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: ๐ฅ Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: โป๏ธ Restore packages cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.cache
${{ github.workspace }}/**/tsconfig.tsbuildinfo
key: ${{ runner.os }}-dx-${{ hashFiles('**/yarn.lock') }}
- name: List changed workspaces
run: yarn workspaces list --since --recursive --json
- name: ๐ฌ ESLint checks
run: |
yarn workspaces foreach --from 'packages/*' -v run lint
- name: ๐ต๏ธ Typecheck
run: |
yarn workspaces foreach --from 'packages/*' -v run typecheck
- name: ๐ Build packages
# Till https://github.com/atlassian/changesets/issues/432 has a solution we can remove the
# build-release and replace with a regular build command
run: |
yarn workspaces foreach --from 'packages/*' -tv run build-release
- name: ๐ Check build for size-limits
run: |
yarn workspaces foreach -v run size-limit
- name: ๐ Check build for ecmascript compliance
if: matrix.node-version == '18.x'
run: |
yarn workspaces foreach -v run check-dist
- name: ๐ Check publishable dist (publint)
if: matrix.node-version == '18.x'
run: yarn workspaces foreach -tv --from 'packages/*' --no-private run check-pub
- name: ๐งช Unit tests
run: |
yarn workspaces foreach -tv --from 'packages/*' run test-unit --coverage
env:
CI: true
- name: ๐งช E2E tests
run: |
yarn g:test-e2e --coverage
env:
CI: true
- name: โ๏ธ Codecov upload
working-directory: ${{ github.workspace }}
if: matrix.node-version == '18.x'
run: |
bash .github/scripts/install-codecov.sh
yarn g:ci-coverage-upload
shell: bash