Skip to content

fix tests

fix tests #847

Workflow file for this run

on:
push:
pull_request:
name: Test
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node: ['18.X']
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
run_install: true
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: pnpm test
build:
needs: test
if: startsWith(github.ref, 'refs/tags/')
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
run_install: true
- uses: actions/setup-node@v3
with:
node-version: 18
- run: pnpm build
- uses: actions/upload-artifact@v3
with:
name: dist
path: |
dist/
deploy_package_npm:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: dist
path: |
dist/
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# deploy_package_github:
# needs: build
# runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/')
# permissions:
# contents: read
# packages: write
# steps:
# - uses: actions/checkout@v3
# - uses: actions/download-artifact@v3
# with:
# name: dist
# path: |
# dist/
# - uses: actions/setup-node@v3
# with:
# node-version: 18
# registry-url: 'https://npm.pkg.github.com'
# - run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: dist
path: |
dist/
- name: Release
uses: softprops/action-gh-release@v1
with:
files: dist
deploy_page:
needs: build
if: startsWith(github.ref, 'refs/tags/')
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
run_install: true
- uses: actions/setup-node@v3
with:
node-version: 18
- run: pnpm doc
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1