我有一个 Node.js 项目的 GitHub 工作流文件:
name: NodeJS CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v2
- name: Using Node version ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
- name: Upload code coverage
run: bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Run Code Online (Sandbox Code Playgroud)
项目结构如下:
.
??? package-lock.json
??? package.json
??? src
? ??? api
? …Run Code Online (Sandbox Code Playgroud)