Skip to content

Commit 2f2ec09

Browse files
committed
CI: add github CI jobs
1 parent 1d82468 commit 2f2ec09

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

.github/workflows/main.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.24.6'
24+
25+
- name: Check formatting
26+
run: make fmt-check
27+
28+
- name: Run linter
29+
run: make lint
30+
31+
build:
32+
name: Build
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: Set up Go
40+
uses: actions/setup-go@v5
41+
with:
42+
go-version: '1.24.6'
43+
44+
- name: Build
45+
run: make build
46+
47+
- name: Build sphinx-cli
48+
run: make sphinx-cli
49+
50+
unit-tests:
51+
name: Unit Tests
52+
runs-on: ubuntu-latest
53+
strategy:
54+
matrix:
55+
unit_type:
56+
- unit
57+
- unit-cover
58+
59+
steps:
60+
- name: Checkout code
61+
uses: actions/checkout@v4
62+
63+
- name: Set up Go
64+
uses: actions/setup-go@v5
65+
with:
66+
go-version: '1.24.6'
67+
68+
- name: Run unit tests
69+
run: make ${{ matrix.unit_type }}
70+
71+
- name: Send coverage
72+
uses: coverallsapp/github-action@v2
73+
if: matrix.unit_type == 'unit-cover'
74+
continue-on-error: true
75+
with:
76+
github-token: ${{ secrets.GITHUB_TOKEN }}
77+
file: coverage.txt
78+
format: golang

0 commit comments

Comments
 (0)