-
Notifications
You must be signed in to change notification settings - Fork 13
73 lines (61 loc) · 1.83 KB
/
test.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
72
73
name: Test
on:
workflow_dispatch:
push:
branches: [master]
pull_request_target:
branches:
- master
concurrency:
group: 'test'
cancel-in-progress: false
jobs:
test:
name: Test Library API Response
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Make envfile
uses: SpicyPizza/[email protected]
with:
envkey_DEBUG: true
envkey_LTOKEN: ${{ secrets.LTOKEN }}
envkey_LTUID: ${{ secrets.LTUID }}
envkey_ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}
envkey_COOKIE_TOKEN: ${{ secrets.COOKIE_TOKEN }}
envkey_ACCOUNT_ID_V2: ${{ secrets.ACCOUNT_ID_V2 }}
envkey_ACCOUNT_MID_V2: ${{ secrets.ACCOUNT_MID_V2 }}
envkey_COOKIE_TOKEN_V2: ${{ secrets.COOKIE_TOKEN_V2 }}
envkey_HI_UID: ${{ secrets.HI_UID }}
envkey_GI_UID: ${{ secrets.GI_UID }}
envkey_HSR_UID: ${{ secrets.HSR_UID }}
- name: Lint
run: npm run lint
- name: Format
run: npm run format
- name: Test and Coverage
run: npm run test:coverage
- name: Create Coverage Badges
uses: jaywcjlove/coverage-badges-cli@main
with:
style: flat
source: coverage/coverage-summary.json
output: coverage/badges.svg
- name: Deploy Test
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./coverage