Skip to content

Commit c06a10e

Browse files
committed
Add CI workflow on PRs/pushes
Tool: gitpod/catfood.gitpod.cloud
1 parent 17a13f8 commit c06a10e

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

Diff for: .github/workflows/ci.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
types: [ opened, edited ]
6+
push:
7+
8+
jobs:
9+
ci:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Setup Go
18+
uses: actions/setup-go@v4
19+
with:
20+
go-version: "1.23.1"
21+
cache: true
22+
23+
- name: Check formatting
24+
run: |
25+
cd gitpod-network-check
26+
test -z "$(gofmt -l .)"
27+
28+
- name: Run tests
29+
run: |
30+
cd gitpod-network-check
31+
go test -v ./...
32+
33+
- name: Build with GoReleaser
34+
uses: goreleaser/goreleaser-action@v3
35+
with:
36+
distribution: goreleaser
37+
version: v1.25.1
38+
args: build --snapshot --clean --skip=publish
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Diff for: .goreleaser.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ builds:
1414
ignore:
1515
- goos: windows
1616
goarch: arm64
17+
flags:
18+
- -a
1719
ldflags:
1820
- -s -w -extldflags=-static
1921
binary: gitpod-network-check

Diff for: gitpod-network-check/cmd/checks.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var checkCommand = &cobra.Command{ // nolint:gochecknoglobals
6262

6363
ts := checks.TestSets[checks.TestsetName(testset)]
6464
serviceEndpoints, subnetType := ts(&NetworkConfig)
65-
subnets := Filter(NetworkConfig.GetAllSubnets(), func(subnet checks.Subnet) bool {
65+
subnets := Filter(NetworkConfig.GetAllSubnets(), func(subnet checks.Subnet) bool {
6666
return subnet.Type == subnetType
6767
})
6868

0 commit comments

Comments
 (0)