2121 name : 🏗 Build Project
2222 runs-on : ubuntu-latest
2323 timeout-minutes : 30
24+ strategy :
25+ matrix :
26+ typescript-version :
27+ ['default', '~4.6.4', '~4.7.4', '~4.8.3', '~4.9.5', '~5.0.4']
28+ steps :
29+ - uses : actions/checkout@v3
30+ with :
31+ ref : ${{ github.event.pull_request.head.sha }}
32+
33+ - name : Install node_modules & package
34+ uses : ./.github/actions/install-node-modules-and-package
35+ with :
36+ typescript-version : ${{ matrix.typescript-version }}
37+
38+ get-affected-packages :
39+ name : 🔎 Get affected packages
40+ needs : build
41+ runs-on : ubuntu-latest
42+ timeout-minutes : 30
2443 outputs :
2544 affected-packages : ${{ steps.get-affected-packages-paths.outputs.affected-packages }}
2645 steps :
@@ -30,36 +49,34 @@ jobs:
3049 # We need to fetch all branches and commits so that Nx affected has a base to compare against.
3150 fetch-depth : 0
3251
33- - name : Install node_modules
34- uses : ./.github/actions/install-node-modules
35-
36- - name : Package
37- uses : ./.github/actions/package
38-
3952 - name : Get affected packages paths
4053 id : get-affected-packages-paths
4154 uses : ./.github/actions/get-affected-packages-paths
4255 with :
4356 base-branch : ${{ github.base_ref }}
4457
4558 library-lint-and-tests :
46- name : 🎯 Run Tests
47- needs : build
59+ name : 🎯 Run tests
60+ needs : [ build, get-affected-packages]
4861 runs-on : ubuntu-latest
49- if : join(fromJson(needs.build .outputs.affected-packages)) != ''
62+ if : join(fromJson(needs.get-affected-packages .outputs.affected-packages)) != ''
5063 timeout-minutes : 30
5164 strategy :
5265 fail-fast : false
5366 matrix :
54- AFFECTED_LIB : ${{ fromJson(needs.build.outputs.affected-packages) }}
67+ AFFECTED_LIB : ${{ fromJson(needs.get-affected-packages.outputs.affected-packages) }}
68+ typescript-version :
69+ ['default', '~4.6.4', '~4.7.4', '~4.8.3', '~4.9.5', '~5.0.4']
5570 steps :
5671 - uses : actions/checkout@v3
5772 with :
5873 ref : ${{ github.event.pull_request.head.sha }}
74+
5975 - name : Run tests
6076 uses : ./.github/actions/lint-and-tests
6177 with :
6278 path : ${{ matrix.AFFECTED_LIB }}
79+ typescript-version : ${{ matrix.typescript-version }}
6380
6481 validate-pr :
6582 name : ✅ Validate the PR
7390 echo "build failed"
7491 exit 1
7592 fi
93+
7694 - name : Validate tests
7795 run : |
7896 if [[ ${{ needs.library-lint-and-tests.result }} = "failure" ]]; then
0 commit comments