Skip to content

Commit 0a9e2ee

Browse files
ci: define workflows in this repository (#168)
1 parent 8a545e3 commit 0a9e2ee

File tree

14 files changed

+105
-125
lines changed

14 files changed

+105
-125
lines changed

.github/actions/go-check-setup/action.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/uci.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/go-check-config.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/go-check.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/go-generate.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
DIR=$(pwd)
6+
TMP=$(mktemp -d)
7+
cd "$TMP"
8+
cp -r "$DIR" orig
9+
cp -r "$DIR" generated
10+
11+
cd generated
12+
# delete all go-generated files generated (that adhere to the comment convention)
13+
grep --include \*.go -lrIZ "^// Code generated .* DO NOT EDIT\.$" . | xargs --null rm
14+
15+
# generate everything
16+
go generate ./...
17+
cd ..

.github/workflows/go-test.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/interop.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,19 @@ name: Interop
44
jobs:
55
interop:
66
runs-on: "ubuntu-latest"
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
go: [ "1.23.x", "1.24.x" ]
711
steps:
812
- uses: actions/checkout@v4
913
- uses: nanasess/setup-chromedriver@v2
1014
with:
1115
# Optional: do not specify to match Chrome's version
1216
chromedriver-version: '124.0.6367.62'
13-
- id: go-mod
14-
uses: pl-strflt/uci/.github/actions/read-go-mod@main
15-
- id: go
16-
env:
17-
GO_MOD_VERSION: ${{ fromJSON(steps.go-mod.outputs.json).Go }}
18-
run: |
19-
MAJOR="${GO_MOD_VERSION%.[0-9]*}"
20-
MINOR="${GO_MOD_VERSION#[0-9]*.}"
21-
echo "version=$MAJOR.$(($MINOR+1)).x" | tee -a $GITHUB_OUTPUT
2217
- uses: actions/setup-go@v5
2318
with:
24-
go-version: ${{ steps.go.outputs.version }}
19+
go-version: ${{ matrix.go }}
2520
- name: Build interop server
2621
run: go build -o interopserver interop/main.go
2722
- uses: actions/setup-python@v5

.github/workflows/lint.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on: [push, pull_request]
2+
3+
jobs:
4+
check:
5+
runs-on: ubuntu-latest
6+
name: Lint
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: actions/setup-go@v5
10+
with:
11+
go-version: "1.24.x"
12+
- name: Check for //go:build ignore in .go files
13+
run: |
14+
IGNORED_FILES=$(grep -rl '//go:build ignore' . --include='*.go') || true
15+
if [ -n "$IGNORED_FILES" ]; then
16+
echo "::error::Found ignored Go files: $IGNORED_FILES"
17+
exit 1
18+
fi
19+
- name: Check that go.mod is tidied
20+
if: success() || failure() # run this step even if the previous one failed
21+
run: |
22+
cp go.mod go.mod.orig
23+
cp go.sum go.sum.orig
24+
go mod tidy
25+
diff go.mod go.mod.orig
26+
diff go.sum go.sum.orig
27+
- name: Run code generators
28+
if: success() || failure() # run this step even if the previous one failed
29+
run: .github/workflows/go-generate.sh
30+
- name: gofmt
31+
if: success() || failure() # run this step even if the previous one failed
32+
run: |
33+
out=$(gofmt -s -l .)
34+
if [[ -n "$out" ]]; then
35+
echo $out | awk '{print "::error file=" $0 ",line=0,col=0::File is not gofmt-ed."}'
36+
exit 1
37+
fi
38+
- name: go vet
39+
if: success() || failure() # run this step even if the previous one failed
40+
run: go vet ./...
41+
- name: Install staticcheck
42+
if: success() || failure() # run this step even if the previous one failed
43+
run: go install honnef.co/go/tools/cmd/staticcheck@v0.6.1
44+
- name: staticcheck
45+
if: success() || failure() # run this step even if the previous one failed
46+
run: |
47+
set -o pipefail
48+
staticcheck ./... | sed -e 's@\(.*\)\.go@./\1.go@g'

.github/workflows/release-check.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/releaser.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)