-
Notifications
You must be signed in to change notification settings - Fork 15
86 lines (72 loc) · 2.21 KB
/
pr_check_service_wiki.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
78
79
80
81
82
83
84
85
86
name: pr_check_service_wiki
on:
pull_request:
branches:
- main
paths:
- "services/wiki/**"
jobs:
pr_check_service_wiki:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14.1
env:
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
ports:
- 10911:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
cache-dependency-path: services/wiki/package-lock.json
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/services/wiki/node_modules
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- name: install dependencies
run: |
cd ${{ github.workspace }}/services/wiki
npm ci --legacy-peer-deps
- name: lint
run: |
cd ${{ github.workspace }}/services/wiki
npx eslint src --max-warnings 0
- name: Set up Prisma
run: |
cd ${{ github.workspace }}/services/wiki
npx prisma generate
- name: Run migrations
run: |
cd ${{ github.workspace }}/services/wiki
npx prisma migrate deploy
- name: Seed the database
run: |
cd ${{ github.workspace }}/services/wiki
npx prisma db seed
- name: test
run: |
cd ${{ github.workspace }}/services/wiki
npm run test -- --coverage
- name: build
run: |
cd ${{ github.workspace }}/services/wiki
npm run build
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
with:
projectBaseDir: services/wiki
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}