-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (95 loc) · 3.14 KB
/
Copy pathci.yml
File metadata and controls
114 lines (95 loc) · 3.14 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
111
112
113
114
name: CI
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
env:
NEXT_TELEMETRY_DISABLED: "1"
ONNXRUNTIME_NODE_INSTALL: skip
jobs:
build:
name: Lint, typecheck & build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node 22
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Generate Prisma client
run: npx prisma generate
- name: Lint
run: npm run lint
- name: Code quality gate
run: npm run codefactor:check
- name: Typecheck
run: npm run typecheck
- name: Unit tests
run: npm test
- name: Build
run: npm run build
env:
SKIP_ENV_VALIDATION: "1"
DATABASE_URL: postgresql://build:build@localhost:5432/build
APP_SECRET: build-secret-placeholder-32-characters
shellcheck:
name: Shellcheck deploy scripts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Run shellcheck
uses: ludeeus/action-shellcheck@2.0.0
with:
scandir: ./deploy
helm:
name: Validate Helm chart
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Helm
uses: azure/setup-helm@v4
- name: Lint chart
run: helm lint --strict deploy/helm/polysiem
- name: Render supported configurations
shell: bash
run: |
helm template polysiem deploy/helm/polysiem --namespace polysiem > /dev/null
helm template polysiem deploy/helm/polysiem --namespace polysiem \
--set ingress.enabled=true \
--set config.appUrl=https://polysiem.example.com > /dev/null
helm template polysiem deploy/helm/polysiem --namespace polysiem \
--set persistence.enabled=false \
--set postgresql.persistence.enabled=false > /dev/null
helm template polysiem deploy/helm/polysiem --namespace polysiem \
--set postgresql.enabled=false \
--set secrets.existingSecret=polysiem-external > /dev/null
helm template polysiem deploy/helm/polysiem --namespace polysiem \
--set service.type=LoadBalancer \
--set service.loadBalancerIP=192.0.2.10 > /dev/null
powershell:
name: Validate PowerShell deployment scripts
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Parse scripts
shell: pwsh
run: |
$failed = $false
Get-ChildItem deploy -Filter *.ps1 | ForEach-Object {
$tokens = $null
$errors = $null
[void][System.Management.Automation.Language.Parser]::ParseFile($_.FullName, [ref]$tokens, [ref]$errors)
if ($errors.Count -gt 0) {
$failed = $true
$errors | ForEach-Object { Write-Error "$($_.Extent.File):$($_.Extent.StartLineNumber): $($_.Message)" }
}
}
if ($failed) { exit 1 }