Merge pull request #261 from skaut/dependabot/npm_and_yarn/uglify-js-… #260
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: "CI" | |
on: | |
push: | |
branches: "*" | |
pull_request: | |
jobs: | |
build: | |
name: "Build" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x, 16.x, 18.x] | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v2 | |
- name: "Setup node" | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: "Cache NPM dependencies" | |
uses: actions/cache@v2 | |
with: | |
path: "~/.npm" | |
key: npm-dependencies-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('package.json') }} | |
restore-keys: | | |
npm-dependencies-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('package.json') }} | |
npm-dependencies-${{ runner.os }}-${{ matrix.node-version }}- | |
- name: "Install NPM dependencies" | |
run: | | |
npm install | |
- name: "Build" | |
run: | | |
npm run build | |
- name: "Upload artifact" | |
uses: actions/upload-artifact@v2 | |
with: | |
name: "build-artifact-${{ matrix.node-version }}" | |
path: dist | |
test: | |
name: "Test" | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
node-version: [14.x, 16.x, 18.x] | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v2 | |
- name: "Setup node" | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: "Cache NPM dependencies" | |
uses: actions/cache@v2 | |
with: | |
path: "~/.npm" | |
key: npm-dependencies-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('package.json') }} | |
restore-keys: | | |
npm-dependencies-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('package.json') }} | |
npm-dependencies-${{ runner.os }}-${{ matrix.node-version }}- | |
- name: "Install NPM dependencies" | |
run: | | |
npm install | |
- name: "Download build artifact" | |
uses: actions/download-artifact@v2 | |
with: | |
name: "build-artifact-${{ matrix.node-version }}" | |
path: dist | |
- name: "Test" | |
run: | | |
npm test | |
- name: "Upload coverage results" | |
continue-on-error: true | |
run: | | |
npm run coverage | |
lint: | |
name: "Lint" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v2 | |
- name: "Setup node" | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: "Cache NPM dependencies" | |
uses: actions/cache@v2 | |
with: | |
path: "~/.npm" | |
key: npm-dependencies-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('package.json') }} | |
restore-keys: | | |
npm-dependencies-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('package.json') }} | |
npm-dependencies-${{ runner.os }}-${{ matrix.node-version }}- | |
- name: "Install NPM dependencies" | |
run: | | |
npm install | |
- name: "Lint" | |
run: | | |
npm run lint |