Skip to content

Commit 862f07f

Browse files
JAORMXclaude
andcommitted
Add CI workflow for test, lint, and build
Excludes CGO packages (krun, propolis-runner) that require libkrun-devel which is not available on standard runners. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6a81046 commit 862f07f

1 file changed

Lines changed: 72 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# SPDX-FileCopyrightText: Copyright 2025 Stacklok, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: CI
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
12+
permissions:
13+
contents: read
14+
15+
env:
16+
GO_VERSION: "1.25"
17+
18+
jobs:
19+
test:
20+
name: Test
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Go
27+
uses: actions/setup-go@v5
28+
with:
29+
go-version: ${{ env.GO_VERSION }}
30+
cache: true
31+
32+
- name: Run tests (excluding CGO packages)
33+
run: |
34+
go test -v -race $(go list ./... | grep -v krun | grep -v propolis-runner)
35+
36+
lint:
37+
name: Lint
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
43+
- name: Set up Go
44+
uses: actions/setup-go@v5
45+
with:
46+
go-version: ${{ env.GO_VERSION }}
47+
cache: true
48+
49+
- name: Install Task
50+
run: |
51+
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
52+
53+
- name: Run linter
54+
run: |
55+
task lint
56+
57+
build:
58+
name: Build
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Checkout repository
62+
uses: actions/checkout@v4
63+
64+
- name: Set up Go
65+
uses: actions/setup-go@v5
66+
with:
67+
go-version: ${{ env.GO_VERSION }}
68+
cache: true
69+
70+
- name: Verify compilation (pure Go packages)
71+
run: |
72+
CGO_ENABLED=0 go build $(go list ./... | grep -v krun | grep -v propolis-runner)

0 commit comments

Comments
 (0)