-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (113 loc) · 3.11 KB
/
Copy pathci.yml
File metadata and controls
123 lines (113 loc) · 3.11 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
119
120
121
122
123
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
merge_group:
env:
CARGO_TERM_COLOR: always
RUST_LOG: pba_service=debug,tower_http=info
DB_HOST: localhost
DB_PORT: "5432"
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: pba_service_test
# Apply pending migrations on service startup (the binary defaults to skipping migrations).
DB_MIGRATION_MODE: run
# Auth is disabled in CI; Keycloak will be added when auth-specific E2E tests are introduced
AUTH_ENABLED: "false"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
commit-convention:
name: Conventional Commit Check
runs-on: ubuntu-latest
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: taiki-e/install-action@v2
with:
tool: cocogitto
checksum: true
- name: Verify PR title follows conventional commit standards
if: ${{ github.event_name == 'pull_request' }}
shell: bash
env:
TITLE: ${{ github.event.pull_request.title }}
run: cog verify "$TITLE"
- name: Verify commit message follows conventional commit standards
if: ${{ github.event_name == 'merge_group' }}
shell: bash
env:
COMMIT_MESSAGE: ${{ github.event.merge_group.head_commit.message }}
run: cog verify "$COMMIT_MESSAGE"
check:
name: Build & Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-toolchain
- run: just fmt-check
- run: just lint
- run: just build
api-e2e:
name: API E2E Tests
runs-on: ubuntu-latest
needs: check
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pba_service_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-toolchain
with:
with-tigerbeetle: "true"
- run: just build
- run: just e2e-start
- run: just api-e2e-run
- if: always()
run: just e2e-stop
ui-e2e:
name: UI E2E Tests
runs-on: ubuntu-latest
needs: check
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pba_service_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-toolchain
with:
with-tigerbeetle: "true"
with-chromium: "true"
- run: just build
- run: just e2e-start
- run: just ui-e2e-run
- if: always()
run: just e2e-stop