refactor: replace calls to npm cli with arborist #143
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 Gushio | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'feature/*' | |
# Allows to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build_and_test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
node_version: [16, 18, 19, 20] | |
env: | |
OS: ${{ matrix.os }} | |
NODEJS: ${{ matrix.node_version }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node_version }} | |
- name: Cache NPM packages | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-${{ matrix.node_version }}-npm-${{ hashFiles('package.json') }} | |
restore-keys: ${{ runner.os }}-${{ matrix.node_version }}-npm | |
- name: Build and test | |
run: | | |
npm install | |
npm test | |
npm run lint | |
- name: Track test coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
env_vars: OS,NODEJS | |
fail_ci_if_error: true |