-
Notifications
You must be signed in to change notification settings - Fork 63
118 lines (96 loc) · 3.18 KB
/
Copy pathci.yml
File metadata and controls
118 lines (96 loc) · 3.18 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
115
116
117
118
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
go-test:
name: Go Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Create frontend dist placeholder
run: mkdir -p web/gocronx-admin/dist && touch web/gocronx-admin/dist/.gitkeep
- name: Format check
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "::error::Unformatted files:" && echo "$unformatted" && exit 1
fi
- name: Vet
run: go vet ./...
- name: Lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2
- name: Test
run: go test -race -coverprofile=coverage.out ./...
- name: Upload coverage
if: github.event_name == 'push'
uses: actions/upload-artifact@v7
with:
name: coverage
path: coverage.out
frontend-build:
name: Frontend Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# pnpm version comes from the "packageManager" field in package.json
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
cache-dependency-path: web/gocronx-admin/pnpm-lock.yaml
- name: Install & Build
working-directory: web/gocronx-admin
run: |
pnpm install --frozen-lockfile
# build-only (vite) first: it generates the auto-import type
# declarations (src/types/import/*.d.ts, gitignored) that vue-tsc
# needs. Then type-check against the generated declarations.
pnpm build-only
pnpm exec vue-tsc --noEmit
- name: Lint
working-directory: web/gocronx-admin
run: pnpm lint
helm-lint:
name: Helm Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: azure/setup-helm@v5
- name: Lint managed deployment
run: >-
helm lint helm/gocron
--set db.host=postgresql.default.svc
--set db.password=ci-password
--set managed.authSecret=ci-auth-secret-with-at-least-32-characters
--set managed.encryptionKey=ci-encryption-key-with-at-least-32-characters
--set managed.admin.password=ci-admin-password
- name: Verify application version alignment
run: |
source_version=$(sed -n 's/.*AppVersion[[:space:]]*= "\([^"]*\)".*/\1/p' cmd/gocron/gocron.go)
chart_version=$(helm show chart helm/gocron | awk '/^appVersion:/ {gsub(/"/, "", $2); print $2}')
test "$source_version" = "$chart_version"
- name: Reject SQLite
run: >-
! helm template gocron helm/gocron
--set db.engine=sqlite
--set db.host=unused
--set db.password=unused
docker-build:
name: Docker Build
runs-on: ubuntu-latest
needs: [go-test, frontend-build]
steps:
- uses: actions/checkout@v6
- name: Build image
run: docker build -f Dockerfile.gocron -t gocron:ci .