Limit artifact uploading to a sigle node version #189
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
node: [16, 18, 20] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'npm' | |
cache-dependency-path: ./package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Test ESLint | |
run: npm run test:eslint | |
- name: Test Markdown | |
run: npm run test:markdown | |
- name: Test Jest | |
run: npm run test:unit | |
- name: Upload coverage artifacts | |
uses: actions/upload-artifact@v1 | |
if: github.ref == 'refs/heads/master' && | |
github.repository == 'yoriiis/svg-chunk-webpack-plugin' && | |
github.event_name != 'pull_request' && | |
matrix.node == '16' | |
with: | |
name: coverage | |
path: coverage | |
- name: Build | |
run: | | |
npm run build | |
npm run build:example | |
deploy-coverage: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: build | |
if: success() && | |
github.ref == 'refs/heads/master' && | |
github.repository == 'yoriiis/svg-chunk-webpack-plugin' && | |
github.event_name != 'pull_request' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download coverage artifacts | |
uses: actions/download-artifact@v1 | |
with: | |
name: coverage | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} |