Skip to content

Commit 5f48b29

Browse files
author
Forge
committed
ci: add Go module caching and fix matrix syntax
- Add actions/cache@v4 for Go modules to prevent timeout - Fix go-version matrix syntax - Keep models catalog refresh step from PR
1 parent 886d08b commit 5f48b29

File tree

1 file changed

+39
-9
lines changed

1 file changed

+39
-9
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,56 @@
11
name: CI
2+
23
on:
34
push:
4-
branches: [main]
5+
branches: [main, feature/*, bugfix/*, docs/*, release/*, hotfix/*]
56
pull_request:
67
branches: [main]
8+
79
jobs:
8-
ci:
10+
test:
911
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
go-version: ['1.21', '1.22']
16+
1017
steps:
1118
- uses: actions/checkout@v4
19+
1220
- name: Refresh models catalog
1321
run: |
1422
git fetch --depth 1 https://github.com/router-for-me/models.git main
1523
mkdir -p pkg/llmproxy/registry/models
1624
git show FETCH_HEAD:models.json > pkg/llmproxy/registry/models/models.json
17-
- uses: actions/setup-go@v5
25+
26+
- name: Setup Go
27+
uses: actions/setup-go@v5
28+
with:
29+
go-version: ${{ matrix.go-version }}
30+
31+
- name: Cache Go modules
32+
uses: actions/cache@v4
1833
with:
19-
go-version-file: go.mod
20-
cache: true
21-
- name: Vet
22-
run: go vet ./...
34+
path: ~/go/pkg/mod
35+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
36+
restore-keys: |
37+
${{ runner.os }}-go-
38+
39+
- name: Download dependencies
40+
run: go mod download
41+
2342
- name: Build
2443
run: go build ./...
25-
- name: Test
26-
run: go test ./...
44+
45+
- name: Run tests
46+
run: go test ./... -v -race -coverprofile=coverage.out
47+
48+
- name: Upload coverage
49+
uses: codecov/codecov-action@v3
50+
with:
51+
files: ./coverage.out
52+
53+
54+
phenotype-validate:
55+
runs-on: ubuntu-latest
56+
uses: KooshaPari/phenotypeActions/.github/workflows/validate-governance.yml@main

0 commit comments

Comments
 (0)