-
Notifications
You must be signed in to change notification settings - Fork 12
55 lines (49 loc) · 1.44 KB
/
vitest.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
name: "Test"
on:
pull_request_target:
branches: [main]
jobs:
authorize:
environment:
${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true
test:
needs: authorize
runs-on: ubuntu-latest
env:
PUBLIC_FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }}
PUBLIC_FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
permissions:
contents: write
steps:
- uses: actions/github-script@v7
id: pr
with:
script: |
const { data: pullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.payload.pull_request.number,
});
return pullRequest
- uses: actions/checkout@v4
with:
ref: ${{fromJSON(steps.pr.outputs.result).merge_commit_sha}}
- uses: pnpm/action-setup@v3
with:
version: 8.14.3
- name: "Install Node"
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"
- name: "Install Deps"
run: pnpm i --frozen-lockfile
- name: "Test"
run: pnpm run test --coverage.enabled true
- name: "Upload Coverage"
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage