-
Notifications
You must be signed in to change notification settings - Fork 3
98 lines (77 loc) · 2.36 KB
/
dev.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
87
88
89
90
91
92
93
94
95
96
97
98
name: Test-runner
on:
pull_request:
branches:
- dev
permissions:
contents: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install Backend Dependencies
run: npm install
- name: Generate Prisma Client
run: npm run prisma:generate
- name: Run Jest
run: npm run test
- name: Run Build
run: npm run build
- name: Run Open API Generator
run: npm run swagger-json
- name: Install Frontend Dependencies
run: cd frontend && npm install
- name: Generate OpenAPI Types
run: cd frontend && npm run openapi-ts-latest
- name: Run Next Build
run: cd frontend && npm run build
lint:
name: Auto-Fix Lint Issues, Generate Swagger JSON and Push to PR and Comment
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Generate Prisma Client
run: npm run prisma:generate
- name: Run Format
run: npm run format
- name: Generate OpenAPI Types
id: openapi_types
run: |
npm run swagger-json
- name: Run ESLint for issues
id: lint_fix_remaining
run: |
npx eslint --fix --config eslint.config.mjs > lint-results.txt || true
- name: Check Lint Results File
run: |
if [ ! -s lint-results.txt ]; then echo "No lint issues found." > lint-results.txt; fi
- name: Comment Remaining Lint Issues
if: ${{ github.event_name == 'pull_request' }}
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728
with:
header: Linter Report
path: lint-results.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}