Feat/fetch request #1
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
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
merge_group: | |
types: [checks_requested] | |
# cancel previous runs on the same PR | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
name: ⛷ PR tests | |
env: | |
CI: true | |
TARGET_SHA: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build-format-lint-test: | |
name: 🚀 Build, format, lint and test | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.TARGET_SHA }} | |
# We need to fetch all branches and commits so that Nx affected has a base to compare against. | |
fetch-depth: 0 | |
- uses: nrwl/nx-set-shas@v3 | |
- name: Install & cache node dependencies | |
uses: ./.github/actions/install-node-deps | |
- name: '💄 Check format' | |
run: pnpm format-check | |
- name: '🧪 Test linter' | |
run: pnpm nx affected --targets=test-linter,test-type,test-circular | |
- name: '🧪 Run unit tests' | |
run: pnpm nx run-many --target=test-unit | |
- name: Install LCOV | |
run: | | |
sudo apt-get update | |
sudo apt-get install lcov | |
- name: '🔃 Merge lcov files' | |
run: ./scripts/merge-lcov.sh |