Skip to content

Commit 07ecce6

Browse files
authored
Merge pull request #5 from brevdev/devin/1754373573-add-github-actions
Add GitHub Actions CI workflow for build, lint, and test
2 parents e70bf62 + f4f9f82 commit 07ecce6

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

.github/workflows/ci.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
name: Test and Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v4
18+
with:
19+
go-version: '1.23.0'
20+
21+
- name: Cache Go modules
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.cache/go-build
26+
~/go/pkg/mod
27+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28+
restore-keys: |
29+
${{ runner.os }}-go-
30+
31+
- name: Install dependencies
32+
run: make deps
33+
34+
- name: Run checks (lint, vet, fmt-check, test)
35+
run: make check
36+
37+
- name: Run security scan
38+
run: make security
39+
continue-on-error: true
40+
41+
- name: Run tests with coverage
42+
run: make test-coverage
43+
44+
- name: Upload coverage reports
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: coverage-report
48+
path: coverage/
49+
50+
build:
51+
name: Cross-platform Build
52+
runs-on: ubuntu-latest
53+
needs: test
54+
strategy:
55+
matrix:
56+
target: [linux, darwin, windows]
57+
steps:
58+
- uses: actions/checkout@v4
59+
60+
- name: Set up Go
61+
uses: actions/setup-go@v4
62+
with:
63+
go-version: '1.23.0'
64+
65+
- name: Cache Go modules
66+
uses: actions/cache@v4
67+
with:
68+
path: |
69+
~/.cache/go-build
70+
~/go/pkg/mod
71+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
72+
restore-keys: |
73+
${{ runner.os }}-go-
74+
75+
- name: Install dependencies
76+
run: make deps
77+
78+
- name: Build for ${{ matrix.target }}
79+
run: make build-${{ matrix.target }}
80+
81+
- name: Upload build artifacts
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: build-${{ matrix.target }}
85+
path: build/

0 commit comments

Comments
 (0)