chore: updated workflows #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
name: CI | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
setup: | |
name: Set up env | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm ci | |
- name: Cache setup | |
uses: actions/cache@v4 | |
with: | |
path: ./* | |
key: ${{ runner.os }}-${{ github.ref }}-${{ github.sha }}-setup | |
linting: | |
name: Verify linting | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
- name: Restore cache | |
uses: actions/cache@v4 | |
with: | |
path: ./* | |
key: ${{ runner.os }}-${{ github.ref }}-${{ github.sha }}-setup | |
- name: Lint | |
run: npm run lint --max-warnings=0 | |
build: | |
name: Build package | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
- name: Restore cache | |
uses: actions/cache@v4 | |
with: | |
path: ./* | |
key: ${{ runner.os }}-${{ github.ref }}-${{ github.sha }}-setup | |
- name: npm run build | |
run: npm run build | |
- name: Cache build | |
uses: actions/cache@v4 | |
with: | |
path: ./* | |
key: ${{ runner.os }}-${{ github.ref }}-${{ github.sha }}-build | |
# unit_tests: | |
# name: Run unit tests | |
# runs-on: ubuntu-latest | |
# needs: build | |
# steps: | |
# - name: Restore cache | |
# uses: actions/cache@v4 | |
# with: | |
# path: ./* | |
# key: ${{ runner.os }}-${{ github.ref }}-${{ github.sha }}-build | |
# - name: Run tests | |
# run: npm run test:unit |