修改github自动化测试脚本-升级node到20 #83
This file contains hidden or 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: Node.js CI | |
on: [push] | |
jobs: | |
unit-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '20.x' | |
- run: pnpm install | |
- run: pnpm run coverage | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
needs: unit-test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '20.x' | |
- run: pnpm install | |
- run: pnpm run build | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: my-artifact | |
path: dist | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
environment: manually | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '20.x' | |
- uses: actions/download-artifact@v2 | |
with: | |
name: my-artifact | |
- run: echo "hello world" | |
- run: ls -al |