clean install #52
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Node.js CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node-version: [16.x, 18.x] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache node modules | |
id: cache-node | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/cache | |
!~/cache/exclude | |
**/node_modules | |
key: node-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
node- | |
- name: check cache | |
if: steps.cache-node.outputs.cache-hit != 'true' | |
run: yarn install | |
- name: lint, build | |
run: | | |
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -" | |
echo ' lint -> build' | |
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -" | |
npm run all | |
- name: Run benchmark | |
run: | | |
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -" | |
echo ' run benchmark' | |
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -" | |
npm run bench | |
npm run benchmark | |
- name: Run tests | |
run: | | |
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -" | |
echo ' run tests' | |
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -" | |
npm run test |