Skip to content

Commit 6a55e51

Browse files
authored
Merge pull request #259 from devfeel/aicode-github-actions
ci: add GitHub Actions workflow
2 parents 6479741 + 107e22b commit 6a55e51

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Go CI
2+
3+
on:
4+
push:
5+
branches: [master, develop, aicode]
6+
pull_request:
7+
branches: [master, develop, aicode]
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Set up Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version: '1.21'
19+
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Download dependencies
24+
run: go mod download
25+
26+
- name: Build
27+
run: go build -v ./...
28+
29+
- name: Run tests
30+
run: go test -v -race -coverprofile=coverage.out ./...
31+
32+
- name: Upload coverage
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: coverage
36+
path: coverage.out
37+
38+
lint:
39+
name: Lint
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- name: Set up Go
44+
uses: actions/setup-go@v5
45+
with:
46+
go-version: '1.21'
47+
48+
- name: Checkout code
49+
uses: actions/checkout@v4
50+
51+
- name: Run golangci-lint
52+
uses: golangci/golangci-lint-action@v6
53+
with:
54+
version: latest

0 commit comments

Comments
 (0)