|
7 | 7 | branches:
|
8 | 8 | - main
|
9 | 9 | jobs:
|
| 10 | + lint: |
| 11 | + name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }} |
| 12 | + |
| 13 | + env: |
| 14 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 15 | + |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + os: [ubuntu-latest] |
| 19 | + node-version: [lts/*] |
| 20 | + |
| 21 | + runs-on: ${{ matrix.os }} |
| 22 | + |
| 23 | + concurrency: |
| 24 | + group: lint-${{ matrix.os }}-v${{ matrix.node-version }}-${{ github.ref }} |
| 25 | + cancel-in-progress: true |
| 26 | + |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v4 |
| 29 | + with: |
| 30 | + fetch-depth: 0 |
| 31 | + |
| 32 | + - name: Use Node.js ${{ matrix.node-version }} |
| 33 | + uses: actions/setup-node@v4 |
| 34 | + with: |
| 35 | + node-version: ${{ matrix.node-version }} |
| 36 | + cache: "npm" |
| 37 | + |
| 38 | + - name: Install dependencies |
| 39 | + run: npm ci |
| 40 | + |
| 41 | + - name: Lint |
| 42 | + run: npm run lint |
| 43 | + |
| 44 | + - name: Security audit |
| 45 | + run: npm run security -- --only=prod |
| 46 | + |
| 47 | + - name: Check commit message |
| 48 | + uses: wagoid/commitlint-github-action@v5 |
| 49 | + |
10 | 50 | build:
|
11 | 51 | name: test Node ${{ matrix.node }} Webpack ${{ matrix.webpack }} ${{ matrix.os }}
|
12 | 52 | timeout-minutes: 15
|
13 | 53 |
|
14 | 54 | runs-on: ${{ matrix.os }}
|
| 55 | + |
| 56 | + concurrency: |
| 57 | + group: test-${{ matrix.os }}-v${{ matrix.node-version }}-${{ matrix.webpack-version }}-${{ github.ref }} |
| 58 | + cancel-in-progress: true |
| 59 | + |
15 | 60 | strategy:
|
16 | 61 | matrix:
|
17 |
| - node: ['10.x', '12.x', '14.x', '16.x', '18.x', '20.x'] |
| 62 | + node: ["10.x", "12.x", "14.x", "16.x", "18.x", "20.x"] |
18 | 63 | os: [ubuntu-latest, windows-latest, macOS-latest]
|
19 |
| - webpack: ['5'] |
| 64 | + webpack: [latest] |
20 | 65 |
|
21 | 66 | steps:
|
22 |
| - - name: LF |
23 |
| - run: git config --global core.autocrlf false |
| 67 | + - name: Setup Git |
| 68 | + if: matrix.os == 'windows-latest' |
| 69 | + run: git config --global core.autocrlf input |
24 | 70 |
|
25 |
| - - name: Checkout repo |
26 |
| - uses: actions/checkout@v2 |
| 71 | + - uses: actions/checkout@v4 |
27 | 72 |
|
28 |
| - - name: Use Node ${{ matrix.node }} |
29 |
| - uses: actions/setup-node@v1 |
| 73 | + - name: Use Node.js ${{ matrix.node-version }} |
| 74 | + uses: actions/setup-node@v4 |
30 | 75 | with:
|
31 |
| - node-version: ${{ matrix.node }} |
| 76 | + node-version: ${{ matrix.node-version }} |
| 77 | + cache: "npm" |
32 | 78 |
|
33 |
| - - name: Install Dependencies |
34 |
| - run: npm install --ignore-scripts --force --legacy-peer-deps |
| 79 | + - name: Install dependencies |
| 80 | + run: npm ci |
35 | 81 |
|
36 |
| - - name: Install Webpack ${{ matrix.webpack }} |
37 |
| - run: npm install --ignore-scripts --force --legacy-peer-deps webpack@${{ matrix.webpack }} |
| 82 | + - name: Install webpack ${{ matrix.webpack-version }} |
| 83 | + if: matrix.webpack-version != 'latest' |
| 84 | + run: npm i webpack@${{ matrix.webpack-version }} |
38 | 85 |
|
39 |
| - - name: Test |
40 |
| - run: npm test -- --forceExit || npm test -- --forceExit || npm test -- --forceExit |
| 86 | + - name: Run tests for webpack version ${{ matrix.webpack-version }} |
| 87 | + run: npm run test:coverage -- --ci |
| 88 | + |
| 89 | + - name: Submit coverage data to codecov |
| 90 | + uses: codecov/codecov-action@v4 |
| 91 | + with: |
| 92 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments