-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·77 lines (70 loc) · 1.96 KB
/
pr.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
74
75
76
77
name: PR
on:
pull_request:
paths-ignore:
- '.github/workflows/**'
jobs:
code-style:
name: code-style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
- run: yarn
- name: build
run: yarn build
- name: code-style check
run: yarn pretty-quick --check --pattern 'src/**/*' --branch origin/main
- name: lint
run: yarn lint
coverage:
name: Coverage report
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DB_USER: postgres
DB_PASS: postgres
DB_DATABASE: postgres
DB_HOST: localhost
DB_PORT: 5432
steps:
- uses: actions/checkout@v4
- name: Enable btree btree_gist
run: psql "postgresql://$DB_USER:$DB_PASS@$DB_HOST:$DB_PORT/$DB_DATABASE" -c "CREATE EXTENSION IF NOT EXISTS btree_gist;"
- name: Use Node20
uses: actions/setup-node@v4
with:
node-version: 20
- name: install dependencies
run: yarn
- name: build
run: yarn build
- uses: artiomtr/jest-coverage-report-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-step: install
package-manager: yarn
working-directory: .
test-script: yarn test:ci
annotations: none
# coverage-file: report.json
base-coverage-file: report-main.json
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: report.json