tests #337
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: tests | |
on: | |
push: | |
pull_request: | |
branches: [ main, next, develop ] | |
schedule: | |
- cron: '0 0 1 * *' | |
jobs: | |
lint-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3.0.0 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Lint | |
run: pnpm lint | |
- name: Build package | |
run: pnpm lib:build | |
unit-tests: | |
name: unit-tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3.0.0 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Unit tests | |
run: pnpm test:unit:coverage | |
- name: Store unit coverage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-unit | |
path: coverage-unit | |
e2e-tests: | |
name: e2e-tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3.0.0 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: pnpm install | |
- name: E2E tests | |
uses: cypress-io/github-action@v6 | |
with: | |
browser: chrome | |
build: pnpm demo:build --config vite.e2e.config.ts | |
start: pnpm demo:preview | |
wait-on: http://127.0.0.1:4173 | |
- name: Store e2e coverage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-e2e | |
path: coverage-e2e | |
upload-coverage: | |
name: upload-coverage | |
needs: [ unit-tests, e2e-tests ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download unit coverage artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage-unit | |
path: coverage/coverage-unit | |
- name: Download e2e coverage artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage-e2e | |
path: coverage/coverage-e2e | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
directory: coverage | |
token: ${{ secrets.CODECOV_TOKEN }} |