Skip to content

feat(gha): add workflow for lint, type-check, and unit test #1

feat(gha): add workflow for lint, type-check, and unit test

feat(gha): add workflow for lint, type-check, and unit test #1

Workflow file for this run

name: "Lint, type check, and unit test"
on:
push:
branches:
- dev
- main
- migrate-to-typescript # TODO: until the migration is complete
- migrate-to-typescript-verify # TODO: remove after the experiment
pull_request:
branches:
- dev
- main
- migrate-to-typescript # TODO: until the migration is complete
workflow_dispatch: # TODO: to manually run the tests. remove later
jobs:
verify:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18.x, 20.x, 22.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- name: Lint
run: npm -w @ntohq/buefy-next run lint
id: lint
continue-on-error: true
- name: Type check
run: npm -w @ntohq/buefy-next run type-check
id: type-check
continue-on-error: true
- name: Unit test
run: npm -w @ntohq/buefy-next run unit
id: unit
continue-on-error: true
- name: Fail if any of the previous steps failed
if: ${{ steps.lint.outcome == 'failure' || steps.type-check.outcome == 'failure' || steps.unit.outcome == 'failure' }}
run: echo "Lint=${{ steps.lint.outcome }} Type-check=${{ steps.type-check.outcome }} Unit=${{ steps.unit.outcome }}" && exit 1