forked from Lilly-Protocol/lily-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (95 loc) · 2.81 KB
/
Copy pathci.yml
File metadata and controls
110 lines (95 loc) · 2.81 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
dependency-audit:
name: Dependency audit
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Audit production dependencies
run: npm audit --omit=dev --audit-level=high
- name: Write workflow summary
if: always()
run: |
{
echo "## Dependency audit"
echo ""
echo "- Command: \`npm audit --omit=dev --audit-level=high\`"
echo "- Status: ${{ job.status }}"
} >> "$GITHUB_STEP_SUMMARY"
validate:
name: ${{ matrix.check.name }}
runs-on: ubuntu-latest
timeout-minutes: 15
env:
CI: true
NEXT_PUBLIC_SITE_URL: https://lilyprotocol.dev
NEXT_PUBLIC_API_BASE_URL: https://api.lilyprotocol.dev
strategy:
fail-fast: false
matrix:
check:
- name: Lint
command: npm run lint
- name: Format
command: npm run format
- name: Typecheck
command: npm run typecheck
- name: Test
command: npm run test:run
- name: Build
command: npm run build
- name: E2E
command: npx playwright test
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
- name: Restore Next.js cache
uses: actions/cache@v6
with:
path: |
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('package-lock.json') }}-${{ hashFiles('src/**/*.{ts,tsx}', 'next.config.ts', 'eslint.config.mjs') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('package-lock.json') }}-
- name: Install dependencies
run: npm ci
- name: Run ${{ matrix.check.name }}
run: ${{ matrix.check.command }}
- name: Write workflow summary
if: always()
run: |
{
echo "## CI Check"
echo ""
echo "- Check: ${{ matrix.check.name }}"
echo "- Command: \`${{ matrix.check.command }}\`"
echo "- Status: ${{ job.status }}"
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload coverage report
if: always() && matrix.check.name == 'Test'
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: coverage