-
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (62 loc) · 2.21 KB
/
build.yaml
File metadata and controls
73 lines (62 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: build
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
types:
- closed
- opened
- reopened
- synchronize
jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
buildAffectedPackages: ${{ steps.get-build-affected-packages.outputs.packages }}
testAffectedPackages: ${{ steps.get-test-affected-packages.outputs.packages }}
if: "!(github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == false)"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Get build affected packages
id: get-build-affected-packages
run: echo "packages=$(pnpm exec foundation-get-affected-projects build origin/${{github.base_ref}})" >> $GITHUB_OUTPUT
- name: Get test affected packages
id: get-test-affected-packages
run: echo "packages=$(pnpm exec foundation-get-affected-project-chunks test origin/${{github.base_ref}} 4)" >> $GITHUB_OUTPUT
- name: Compile source files
run: pnpm run build
- name: Lint affected source files
run: pnpm run lint --filter=[origin/${{github.base_ref}}]
- name: Check for unused code
run: pnpm run unused --no-config-hints
test-package:
name: Test package
needs: build
runs-on: ubuntu-latest
if: ${{ needs.build.outputs.testAffectedPackages != '[]' }}
strategy:
matrix:
packages: ${{fromJSON(needs.build.outputs.testAffectedPackages)}}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Launch Unit Tests
run: pnpm run test:unit --filter ${{ join(matrix.packages, ' --filter ') }}
- name: Launch Integration Tests
run: pnpm run test:integration --filter ${{ join(matrix.packages, ' --filter ') }}
done:
name: Done
needs:
- test-package
runs-on: ubuntu-latest
steps:
- run: 'echo "Done!"'