-
Notifications
You must be signed in to change notification settings - Fork 27
47 lines (37 loc) · 1.27 KB
/
build-and-test.yml
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
name: Build and test mochapack
on:
push:
branches: [master]
pull_request:
jobs:
build:
strategy:
matrix:
node: [18, 20]
mocha: [7, 8, 9]
webpack: [4, 5]
name: "Mocha ${{matrix.mocha}} w/ Webpack ${{matrix.webpack}} w/ Node.js ${{matrix.node}}.x"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Use Node.js ${{matrix.node}}"
uses: actions/setup-node@master
with:
node-version: ${{matrix.node}}.x
- name: Install
run: |
npm i -g nari
nari
- name: Change webpack and mocha versions
run: |
nari add -D webpack@${{ matrix.webpack }} mocha@${{ matrix.mocha }}
- name: Prepare for tests
run: |
if [ ${{ matrix.webpack }} == 4 ]; then echo -e "// @ts-nocheck\n/*eslint-disable*/\n$(cat src/webpack/util/getAffectedModuleIds.ts)" > src/webpack/util/getAffectedModuleIds.ts; fi
if [ ${{ matrix.webpack }} == 5 ]; then echo -e "// @ts-nocheck\n$(cat src/webpack/util/webpack4GetBuildStats.ts)" > src/webpack/util/webpack4GetBuildStats.ts; fi
- name: Run tests
run: |
nari cover
- name: Check coverage
run: |
bash <(curl -s https://codecov.io/bash)