Skip to content

Commit

Permalink
test: reduce workflow size
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Apr 14, 2021
1 parent e8934b8 commit ebf324d
Showing 1 changed file with 43 additions and 8 deletions.
51 changes: 43 additions & 8 deletions .github/workflows/nodejs.yml
Expand Up @@ -50,17 +50,13 @@ jobs:
uses: wagoid/commitlint-github-action@v1

test:
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}, experimentalUseImportModule ${{ matrix.experimental-use-import-module }}
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10.x, 12.x, 14.x]
webpack-version: [4, latest]
experimental-use-import-module: [false, true]
exclude:
- webpack-version: 4
experimental-use-import-module: true

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -91,11 +87,50 @@ jobs:
run: npm i webpack@${{ matrix.webpack-version }}

- name: Run tests for webpack version ${{ matrix.webpack-version }}
if: ${{ !matrix.experimental-use-import-module }}
run: npm run test:coverage -- --ci

- name: Run optional tests for webpack version ${{ matrix.webpack-version }} with import module
if: ${{ matrix.experimental-use-import-module }}
- name: Submit coverage data to codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

test2:
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack latest, experimentalUseImportModule

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10.x, 12.x, 14.x]

runs-on: ${{ matrix.os }}

steps:
- name: Setup Git
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf input

- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Use latest NPM on ubuntu/macos
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: sudo npm i -g npm

- name: Use latest NPM on windows
if: matrix.os == 'windows-latest'
run: npm i -g npm

- name: Install dependencies
run: npm i

- name: Install webpack latest
run: npm i webpack@latest

- name: Run tests for webpack version latest with experimentalUseImportModule
run: EXPERIMENTAL_USE_IMPORT_MODULE=true npm run test:coverage -- --ci

- name: Submit coverage data to codecov
Expand Down

0 comments on commit ebf324d

Please sign in to comment.