Skip to content

chore: 升级开发依赖包 #508

chore: 升级开发依赖包

chore: 升级开发依赖包 #508

Workflow file for this run

name: Test
on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
branches:
jobs:
formatting:
if: "!contains(toJson(github.event.commits), '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
cache: 'pnpm'
- run: pnpm install
- run: npx --no-install prettier --cache --verbose --check .
type-checking:
if: "!contains(toJson(github.event.commits), '[skip ci]')"
strategy:
matrix:
node-version: [18.x, 20.x]
ts-version: [5.0.x, 5.1.x, 5.2.x, 5.3.x]
react-version: [18.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node.js ${{ matrix.node-version }} & Typescript ${{ matrix.ts-version }} & React ${{ matrix.react-version }}
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}
- run: |
pnpm install
pnpm add -D \
typescript@${{ matrix.ts-version }} \
react@${{ matrix.react-version }} \
react-dom@${{ matrix.react-version }}
- run: npx --no-install tsc --noEmit
test:
if: "!contains(toJson(github.event.commits), '[skip ci]')"
strategy:
matrix:
node-version: [18.x, 20.x]
react-version: [18.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node.js ${{ matrix.node-version }} & React ${{ matrix.react-version }}
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}
- run: |
pnpm install
pnpm add -D \
react@${{ matrix.react-version }} \
react-dom@${{ matrix.react-version }} \
react-test-renderer@${{ matrix.react-version }}
- run: pnpm run test
- name: Upload Coverage
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/master'
with:
name: coverage
path: coverage
if-no-files-found: error
retention-days: 1
coverage:
if: github.ref == 'refs/heads/master'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download Coverage
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage
- uses: codecov/codecov-action@v3