-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (64 loc) · 1.88 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Tests
on:
push:
branches: [main]
paths:
- .github/workflows/tests.yml
- package.json
- pnpm-lock.yaml
- src/**
- test/**
- tsconfig*.json
- vitest.config.ts
- wrangler.toml
pull_request:
branches: [main]
# Same paths that are used on push.
paths:
- .github/workflows/tests.yml
- package.json
- pnpm-lock.yaml
- src/**
- test/**
- tsconfig*.json
- vitest.config.ts
- wrangler.toml
workflow_dispatch:
jobs:
vitest:
name: Test with Vitest
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
# Don't run for some dependabot PRs.
# Particularly, things which should not affect test outputs.
# Ex. @vitest/ui, ESLint-related stuff, husky.
if: |
!(
github.event_name == 'pull_request' &&
github.actor == 'dependabot[bot]' &&
(
contains(github.head_ref, 'dependabot/npm_and_yarn/typescript-eslint') ||
contains(github.head_ref, 'dependabot/npm_and_yarn/vitest/ui') ||
contains(github.head_ref, 'dependabot/npm_and_yarn/husky') ||
contains(github.head_ref, 'dependabot/npm_and_yarn/concurrently') ||
contains(github.head_ref, 'dependabot/npm_and_yarn/eslint') ||
contains(github.head_ref, 'dependabot/npm_and_yarn/lint-staged') ||
contains(github.head_ref, 'dependabot/npm_and_yarn/is-ci')
)
)
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Run Vitest
run: npm test -- --coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3