unit test #2563
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: unit test | |
on: | |
push: | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
test: | |
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node_version: ['16', '18'] | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: pnpm/[email protected] | |
with: | |
version: 7.0.0 | |
- name: Setup git config | |
run: | | |
git config --global user.name "GitHub Actions Bot" | |
git config --global user.email "<>" | |
- name: use Node.js ${{ matrix.node_version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node_version }} | |
cache: 'pnpm' | |
- name: Install dependencies ignore scripts | |
run: pnpm install --ignore-scripts | |
- name: Build | |
run: pnpm run build | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run lint | |
run: pnpm run lint | |
- name: Run unit test | |
run: pnpm --filter elint run test:unit | |
- name: Upload coverage to Codecov | |
if: matrix.node_version == 16 && matrix.os == 'ubuntu-latest' | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
file: ./coverage/lcov.info |