Skip to content

Commit b0dcc00

Browse files
authored
Merge pull request #6 from Paca-AI/ci/implement-ci-pipeline
ci: implement ci pipeline
2 parents 4040baa + f7a3610 commit b0dcc00

3 files changed

Lines changed: 207 additions & 0 deletions

File tree

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: backend-pr-ci
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "backend/**"
7+
- ".github/workflows/backend-pr-ci.yml"
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: backend-pr-ci-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
env:
18+
GO_VERSION: "1.24"
19+
20+
jobs:
21+
lint:
22+
name: Lint
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 10
25+
26+
defaults:
27+
run:
28+
working-directory: backend
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 1
35+
36+
- name: Setup Go
37+
uses: actions/setup-go@v5
38+
with:
39+
go-version: ${{ env.GO_VERSION }}
40+
cache-dependency-path: backend/go.sum
41+
42+
- name: Install golangci-lint
43+
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
44+
45+
- name: Run golangci-lint
46+
run: golangci-lint run --timeout=5m
47+
48+
build:
49+
name: Build
50+
runs-on: ubuntu-latest
51+
timeout-minutes: 10
52+
53+
defaults:
54+
run:
55+
working-directory: backend
56+
57+
steps:
58+
- name: Checkout repository
59+
uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 1
62+
63+
- name: Setup Go
64+
uses: actions/setup-go@v5
65+
with:
66+
go-version: ${{ env.GO_VERSION }}
67+
cache-dependency-path: backend/go.sum
68+
69+
- name: Build WASM
70+
run: GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o example.wasm .
71+
72+
test:
73+
name: Tests
74+
runs-on: ubuntu-latest
75+
timeout-minutes: 15
76+
77+
defaults:
78+
run:
79+
working-directory: backend
80+
81+
steps:
82+
- name: Checkout repository
83+
uses: actions/checkout@v4
84+
with:
85+
fetch-depth: 1
86+
87+
- name: Setup Go
88+
uses: actions/setup-go@v5
89+
with:
90+
go-version: ${{ env.GO_VERSION }}
91+
cache-dependency-path: backend/go.sum
92+
93+
- name: Run tests (race detector)
94+
run: go test -race -timeout 60s -coverprofile=coverage.out $(go list ./...)
95+
96+
- name: Upload coverage report
97+
uses: actions/upload-artifact@v4
98+
with:
99+
name: coverage-report
100+
path: backend/coverage.out
101+
retention-days: 7
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: frontend-pr-ci
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "frontend/**"
7+
- ".github/workflows/frontend-pr-ci.yml"
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: frontend-pr-ci-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
web-quality:
19+
name: Typecheck and build frontend
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 20
22+
23+
defaults:
24+
run:
25+
working-directory: frontend
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Setup Bun
34+
uses: oven-sh/setup-bun@v2
35+
with:
36+
bun-version: "1.2.23"
37+
38+
- name: Cache Bun packages
39+
uses: actions/cache@v4
40+
with:
41+
path: ~/.bun/install/cache
42+
key: ${{ runner.os }}-bun-${{ hashFiles('frontend/bun.lock') }}
43+
restore-keys: |
44+
${{ runner.os }}-bun-
45+
46+
- name: Install dependencies
47+
run: bun install --frozen-lockfile
48+
49+
- name: Typecheck
50+
run: bun run typecheck
51+
52+
- name: Build production bundle
53+
run: bun run build

.github/workflows/mcp-pr-ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: mcp-pr-ci
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "mcp/**"
7+
- ".github/workflows/mcp-pr-ci.yml"
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: mcp-pr-ci-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
mcp-quality:
19+
name: Typecheck and build MCP server
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 10
22+
23+
defaults:
24+
run:
25+
working-directory: mcp
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Setup Bun
34+
uses: oven-sh/setup-bun@v2
35+
with:
36+
bun-version: "1.2.23"
37+
38+
- name: Cache Bun packages
39+
uses: actions/cache@v4
40+
with:
41+
path: ~/.bun/install/cache
42+
key: ${{ runner.os }}-bun-mcp-${{ hashFiles('mcp/bun.lock') }}
43+
restore-keys: |
44+
${{ runner.os }}-bun-mcp-
45+
46+
- name: Install dependencies
47+
run: bun install --frozen-lockfile
48+
49+
- name: Typecheck
50+
run: bun run typecheck
51+
52+
- name: Build
53+
run: bun run build

0 commit comments

Comments
 (0)