chore: 🔧 add test helper, increase coverage #10
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 | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build-lint-test: | |
env: | |
CI: true | |
HUSKY: 0 | |
runs-on: ${{ matrix.os }} | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: use nodejs ${{ matrix.node-version }} on ${{ matrix.os }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: yarn cache | |
id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v2 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: install | |
run: yarn | |
- name: lint | |
run: yarn lint | |
- name: test | |
run: yarn test | |
- name: build | |
run: yarn build | |
# release: | |
# needs: build-lint-test | |
# name: release | |
# runs-on: ubuntu-latest | |
# env: | |
# CI: true | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# HUSKY: 0 | |
# steps: | |
# - name: checkout | |
# uses: actions/checkout@v2 | |
# - name: setup node.js | |
# uses: actions/setup-node@v2 | |
# with: | |
# node-version: 20 | |
# - name: get yarn cache | |
# id: yarn-cache | |
# run: echo "::set-output name=dir::$(yarn cache dir)" | |
# - uses: actions/cache@v2 | |
# with: | |
# path: ${{ steps.yarn-cache.outputs.dir }} | |
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
# restore-keys: | | |
# ${{ runner.os }}-yarn- | |
# - name: install dependencies | |
# run: yarn | |
# - name: release | |
# run: npx semantic-release |