@@ -32,30 +32,39 @@ jobs:
3232
3333 unit-test :
3434 runs-on : ubuntu-latest
35+ strategy :
36+ matrix :
37+ # only LTS versions starting from the lowest we support
38+ # TODO: Include Nodejs@14
39+ node-version : ['16', '18', '20']
3540 env :
3641 cache-name : cache-node-modules
42+ NYC_REPORT_DIR : coverage_unit_node${{ matrix.node-version }}
3743
3844 steps :
45+ - uses : actions/setup-node@v4
46+ with :
47+ node-version : ${{ matrix.node-version }}
3948 - uses : actions/checkout@v3
4049 - name : Cache node modules
4150 uses : actions/cache@v3
4251 with :
4352 path : ~/.npm
44- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
53+ key : ${{ runner.os }}-${{ matrix.node-version }}- build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
4554 restore-keys : |
46- ${{ runner.os }}-build-${{ env.cache-name }}-
47- ${{ runner.os }}-build-
48- ${{ runner.os }}-
55+ ${{ runner.os }}-${{ matrix.node-version }}- build-${{ env.cache-name }}-
56+ ${{ runner.os }}-${{ matrix.node-version }}- build-
57+ ${{ runner.os }}-${{ matrix.node-version }}-
4958 - name : Run unit tests
5059 run : |
5160 npm ci
5261 npm run test
53- - run : tar -cvf coverage_unit. tar coverage_unit
62+ - run : tar -cvf ${{ env.NYC_REPORT_DIR }}. tar ${{ env.NYC_REPORT_DIR }}
5463 - name : Store coverage report
55- uses : actions/upload-artifact@v3
64+ uses : actions/upload-artifact@v4
5665 with :
57- name : coverage_unit
58- path : coverage_unit .tar
66+ name : ${{ env.NYC_REPORT_DIR }}
67+ path : ${{ env.NYC_REPORT_DIR }} .tar
5968 retention-days : 1
6069
6170 e2e-test :
6776 E2E_ACCESS_TOKEN : ${{ secrets.DATABRICKS_TOKEN }}
6877 E2E_TABLE_SUFFIX : ${{github.sha}}
6978 cache-name : cache-node-modules
79+ NYC_REPORT_DIR : coverage_e2e
7080
7181 steps :
7282 - uses : actions/checkout@v3
@@ -83,12 +93,12 @@ jobs:
8393 run : |
8494 npm ci
8595 NODE_OPTIONS="--max-old-space-size=4096" npm run e2e
86- - run : tar -cvf coverage_e2e. tar coverage_e2e
96+ - run : tar -cvf ${{ env.NYC_REPORT_DIR }}. tar ${{ env.NYC_REPORT_DIR }}
8797 - name : Store coverage report
88- uses : actions/upload-artifact@v3
98+ uses : actions/upload-artifact@v4
8999 with :
90- name : coverage_e2e
91- path : coverage_e2e .tar
100+ name : ${{ env.NYC_REPORT_DIR }}
101+ path : ${{ env.NYC_REPORT_DIR }} .tar
92102 retention-days : 1
93103
94104 coverage :
@@ -108,14 +118,15 @@ jobs:
108118 ${{ runner.os }}-build-${{ env.cache-name }}-
109119 ${{ runner.os }}-build-
110120 ${{ runner.os }}-
111- - uses : actions/download-artifact@v3
112- with :
113- name : coverage_unit
114- - uses : actions/download-artifact@v3
121+ - uses : actions/download-artifact@v4
115122 with :
116- name : coverage_e2e
117- - run : tar -xvf coverage_unit.tar && rm coverage_unit.tar
118- - run : tar -xvf coverage_e2e.tar && rm coverage_e2e.tar
123+ pattern : coverage_*
124+ merge-multiple : true
125+ - name : Unpack coverage reports
126+ run : |
127+ ls -1 coverage_*.tar | xargs -I '{}' -- tar -xvf '{}'
128+ rm coverage_*.tar
129+ - run : ls -la
119130 - name : Coverage
120131 uses : codecov/codecov-action@v3
121132 with :
0 commit comments