-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (50 loc) · 1.34 KB
/
ci.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
name: PR Checks
on:
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Print head and base refs
run: |
echo "Head ref: ${{ github.head_ref }}"
echo "Base ref: ${{ github.base_ref }}"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-node-18-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-18-yarn-
- name: Install dependencies
run: yarn install
- name: Type check
run: yarn typecheck
- name: Check code quality
run: |
yarn lint
yarn format:check
yarn run --if-present generate
- name: Security Audit
run: yarn audit --level moderate || true
continue-on-error: true
- name: Security Audit Summary
if: success() || failure()
run: yarn audit --summary
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: ./build/
- name: Error handling
if: failure()
run: echo "CI failed. Please check the logs."