Skip to content

feat: improve DX & refactor CI #44

feat: improve DX & refactor CI

feat: improve DX & refactor CI #44

Workflow file for this run

name: Node.js CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [^16, ^18]
steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Setup
run: npm i -g @antfu/ni
- name: Install
run: pnpm install --no-frozen-lockfile
- name: TypeCheck
run: nr typecheck
- name: Lint
run: nr lint
- name: Style
run: nr style
- name: Test
run: nr test
- name: Coverage
run: nr coverage
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.node-version }}
parallel: true
report:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
release:
needs: report
runs-on: ubuntu-latest
if: github.repository == 'node-casbin/nest-authz' && github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ^18
cache: pnpm
- run: pnpm install --no-frozen-lockfile
- run: pnpm build
- run: npx -p semantic-release -p @semantic-release/git -p @semantic-release/changelog semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}