|
| 1 | +name: mini-css-extract-plugin |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - next |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - master |
| 11 | + - next |
| 12 | + |
| 13 | +jobs: |
| 14 | + lint: |
| 15 | + name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }} |
| 16 | + |
| 17 | + env: |
| 18 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 19 | + |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + os: [ubuntu-latest] |
| 23 | + node-version: [12.x] |
| 24 | + |
| 25 | + runs-on: ${{ matrix.os }} |
| 26 | + |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v2 |
| 29 | + with: |
| 30 | + fetch-depth: 0 |
| 31 | + |
| 32 | + - name: Use Node.js ${{ env.node-version }} |
| 33 | + uses: actions/setup-node@v1 |
| 34 | + with: |
| 35 | + node-version: ${{ env.node-version }} |
| 36 | + |
| 37 | + - name: Use latest NPM |
| 38 | + run: sudo npm i -g npm |
| 39 | + |
| 40 | + - name: Install dependencies |
| 41 | + run: npm ci |
| 42 | + |
| 43 | + - name: Lint |
| 44 | + run: npm run lint |
| 45 | + |
| 46 | + # - name: Security audit |
| 47 | + # run: npm run security |
| 48 | + |
| 49 | + - name: Check commit message |
| 50 | + uses: wagoid/commitlint-github-action@v1 |
| 51 | + |
| 52 | + test: |
| 53 | + name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }} |
| 54 | + |
| 55 | + strategy: |
| 56 | + matrix: |
| 57 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 58 | + # css-loader doesn't support node@6 |
| 59 | + node-version: [8.x, 10.x, 12.x, 14.x] |
| 60 | + webpack-version: [latest, next] |
| 61 | + exclude: |
| 62 | + # Webpack 5 does not support node 6 and 8 |
| 63 | + - node-version: 8.x |
| 64 | + webpack-version: next |
| 65 | + |
| 66 | + runs-on: ${{ matrix.os }} |
| 67 | + |
| 68 | + steps: |
| 69 | + - name: Setup Git |
| 70 | + if: matrix.os == 'windows-latest' |
| 71 | + run: git config --global core.autocrlf input |
| 72 | + |
| 73 | + - uses: actions/checkout@v2 |
| 74 | + |
| 75 | + - name: Use Node.js ${{ matrix.node-version }} |
| 76 | + uses: actions/setup-node@v1 |
| 77 | + with: |
| 78 | + node-version: ${{ matrix.node-version }} |
| 79 | + |
| 80 | + - name: Use latest NPM on ubuntu/macos |
| 81 | + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' |
| 82 | + run: sudo npm i -g npm |
| 83 | + |
| 84 | + - name: Use latest NPM on windows |
| 85 | + if: matrix.os == 'windows-latest' |
| 86 | + run: npm i -g npm |
| 87 | + |
| 88 | + - name: Install dependencies |
| 89 | + run: npm i |
| 90 | + |
| 91 | + - name: Install webpack ${{ matrix.webpack-version }} |
| 92 | + run: npm i webpack@${{ matrix.webpack-version }} |
| 93 | + |
| 94 | + - name: Run tests for webpack version ${{ matrix.webpack-version }} |
| 95 | + run: npm run test:coverage -- --ci |
| 96 | + |
| 97 | + - name: Submit coverage data to codecov |
| 98 | + uses: codecov/codecov-action@v1 |
| 99 | + with: |
| 100 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments