1010
1111env :
1212 CI : true
13- NODE_VERSION : 16
13+ NODE_VERSION : 18
1414
1515defaults :
1616 run :
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+ runs-on : ubuntu-latest
41+ timeout-minutes : 30
2442 outputs :
2543 affected-packages : ${{ steps.get-affected-packages-paths.outputs.affected-packages }}
2644 steps :
@@ -30,36 +48,34 @@ jobs:
3048 # We need to fetch all branches and commits so that Nx affected has a base to compare against.
3149 fetch-depth : 0
3250
33- - name : Install node_modules
34- uses : ./.github/actions/install-node-modules
35-
36- - name : Package
37- uses : ./.github/actions/package
38-
3951 - name : Get affected packages paths
4052 id : get-affected-packages-paths
4153 uses : ./.github/actions/get-affected-packages-paths
4254 with :
4355 base-branch : ${{ github.base_ref }}
4456
4557 library-lint-and-tests :
46- name : 🎯 Run Tests
47- needs : build
58+ name : 🎯 Run tests
59+ needs : [ build, get-affected-packages]
4860 runs-on : ubuntu-latest
49- if : join(fromJson(needs.build .outputs.affected-packages)) != ''
61+ if : join(fromJson(needs.get-affected-packages .outputs.affected-packages)) != ''
5062 timeout-minutes : 30
5163 strategy :
5264 fail-fast : false
5365 matrix :
54- AFFECTED_LIB : ${{ fromJson(needs.build.outputs.affected-packages) }}
66+ affected-package : ${{ fromJson(needs.get-affected-packages.outputs.affected-packages) }}
67+ typescript-version :
68+ ['default', '~4.6.4', '~4.7.4', '~4.8.3', '~4.9.5', '~5.0.4']
5569 steps :
5670 - uses : actions/checkout@v3
5771 with :
5872 ref : ${{ github.event.pull_request.head.sha }}
73+
5974 - name : Run tests
6075 uses : ./.github/actions/lint-and-tests
6176 with :
62- path : ${{ matrix.AFFECTED_LIB }}
77+ path : ${{ matrix.affected-package }}
78+ typescript-version : ${{ matrix.typescript-version }}
6379
6480 validate-pr :
6581 name : ✅ Validate the PR
7389 echo "build failed"
7490 exit 1
7591 fi
92+
7693 - name : Validate tests
7794 run : |
7895 if [[ ${{ needs.library-lint-and-tests.result }} = "failure" ]]; then
0 commit comments