1010
1111env :
1212 CI : true
13- NODE_VERSION : 16
13+ NODE_VERSION : 18
1414
1515defaults :
1616 run :
@@ -21,37 +21,51 @@ jobs:
2121 name : 🏗 Build Project
2222 runs-on : ubuntu-latest
2323 timeout-minutes : 30
24- outputs :
25- affected-packages : ${{ steps.get-affected-packages-paths.outputs.affected-packages }}
24+ strategy :
25+ matrix :
26+ node-version : [16, 18]
27+ typescript-version :
28+ ['default', '~4.6.4', '~4.7.4', '~4.8.3', '~4.9.5', '~5.0.4']
2629 steps :
2730 - uses : actions/checkout@v3
2831 with :
2932 ref : ${{ github.event.pull_request.head.sha }}
3033 # We need to fetch all branches and commits so that Nx affected has a base to compare against.
3134 fetch-depth : 0
3235
33- - name : Install node_modules
36+ - name : Install node_modules & package
3437 uses : ./.github/actions/install-node-modules
38+ with :
39+ path : ${{ matrix.AFFECTED_LIB }}
40+ node-version : ${{ matrix.node-version }}
41+ typescript-version : ${{ matrix.typescript-version }}
3542
36- - name : Package
37- uses : ./.github/actions/package
38-
43+ get-affected-packages :
44+ name : 🔎 Get affected packages
45+ runs-on : ubuntu-latest
46+ timeout-minutes : 30
47+ outputs :
48+ affected-packages : ${{ steps.get-affected-packages-paths.outputs.affected-packages }}
49+ steps :
3950 - name : Get affected packages paths
4051 id : get-affected-packages-paths
4152 uses : ./.github/actions/get-affected-packages-paths
4253 with :
4354 base-branch : ${{ github.base_ref }}
4455
4556 library-lint-and-tests :
46- name : 🎯 Run Tests
47- needs : build
57+ name : ' 🎯 Run ${{ matrix.AFFECTED_LIB }} tests (Node${{ matrix.node-version }}, TS${{ matrix.typescript-version }}) '
58+ needs : [ build, get-affected-packages]
4859 runs-on : ubuntu-latest
4960 if : join(fromJson(needs.build.outputs.affected-packages)) != ''
5061 timeout-minutes : 30
5162 strategy :
5263 fail-fast : false
5364 matrix :
54- AFFECTED_LIB : ${{ fromJson(needs.build.outputs.affected-packages) }}
65+ AFFECTED_LIB : ${{ fromJson(needs.get-affected-packages.outputs.affected-packages) }}
66+ node-version : [16, 18]
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 :
@@ -60,19 +74,27 @@ jobs:
6074 uses : ./.github/actions/lint-and-tests
6175 with :
6276 path : ${{ matrix.AFFECTED_LIB }}
77+ node-version : ${{ matrix.node-version }}
78+ typescript-version : ${{ matrix.typescript-version }}
6379
6480 validate-pr :
6581 name : ✅ Validate the PR
6682 runs-on : ubuntu-latest
6783 if : ${{ always() }}
68- needs : [build, library-lint-and-tests]
84+ needs : [build, get-affected-packages, library-lint-and-tests]
6985 steps :
7086 - name : Validate build
7187 run : |
7288 if [[ ${{ needs.build.result }} = "failure" ]]; then
7389 echo "build failed"
7490 exit 1
7591 fi
92+ - name : Validate get-affected-packages
93+ run : |
94+ if [[ ${{ needs.get-affected-packages.result }} = "failure" ]]; then
95+ echo "get-affected-packages failed"
96+ exit 1
97+ fi
7698 - name : Validate tests
7799 run : |
78100 if [[ ${{ needs.library-lint-and-tests.result }} = "failure" ]]; then
0 commit comments