Skip to content

Commit 04a7ccd

Browse files
author
aibuddy
committed
scripts+ci: introduce scripts submodule and CI workflow
1 parent 72a0594 commit 04a7ccd

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed

.github/workflows/ci.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ develop, main, master ]
6+
pull_request:
7+
branches: [ '**' ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
name: ${{ matrix.os }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ ubuntu-latest, macos-latest, windows-latest ]
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version-file: go.mod
29+
cache: true
30+
31+
- name: Print Go version
32+
run: go version
33+
34+
- name: Install ripgrep (Linux)
35+
if: runner.os == 'Linux'
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install -y ripgrep
39+
40+
- name: Install ripgrep (macOS)
41+
if: runner.os == 'macOS'
42+
run: |
43+
brew update
44+
brew install ripgrep
45+
46+
- name: Install make and ripgrep (Windows)
47+
if: runner.os == 'Windows'
48+
shell: bash
49+
run: |
50+
choco install -y make ripgrep
51+
echo "make version:"; make --version || true
52+
echo "rg version:"; rg --version || true
53+
54+
- name: Print Go env
55+
run: go env
56+
57+
- name: Tidy
58+
shell: bash
59+
run: make tidy
60+
61+
- name: lint (includes check-go-version)
62+
shell: bash
63+
run: |
64+
set -o pipefail
65+
make lint 2>&1 | tee lint.log
66+
67+
- name: Assert lint order (check-go-version before golangci-lint)
68+
shell: bash
69+
run: |
70+
test -f lint.log || { echo "lint.log missing"; exit 1; }
71+
L_CHECK=$(rg -n "^check-go-version: OK" -N lint.log | head -1 | cut -d: -f1)
72+
L_GCL=$(rg -n "^golangci-lint version" -N lint.log | head -1 | cut -d: -f1)
73+
if [ -z "$L_CHECK" ]; then echo "Missing 'check-go-version: OK' line in lint.log"; exit 1; fi
74+
if [ -z "$L_GCL" ]; then echo "Missing 'golangci-lint version' line in lint.log"; exit 1; fi
75+
if [ "$L_CHECK" -ge "$L_GCL" ]; then
76+
echo "Ordering incorrect: 'check-go-version: OK' occurs at line $L_CHECK, after golangci-lint version at line $L_GCL"; exit 1;
77+
fi
78+
echo "Lint order OK: check-go-version runs before golangci-lint"
79+
80+
- name: Upload lint.log artifact
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: lint-${{ matrix.os }}
84+
path: lint.log
85+
if-no-files-found: error
86+
87+
- name: Tools path hygiene
88+
shell: bash
89+
run: make check-tools-paths
90+
91+
- name: Verify tools manifest commands
92+
shell: bash
93+
run: make verify-manifest-paths
94+
95+
- name: Test
96+
shell: bash
97+
run: make test
98+
99+
- name: Test clean-logs guard
100+
shell: bash
101+
run: make test-clean-logs
102+
103+
- name: Build
104+
shell: bash
105+
run: make build
106+
107+
- name: Build tools
108+
shell: bash
109+
run: make build-tools

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule ".cursor/rules"]
2+
path = .cursor/rules
3+
url = git@github.com:hyperifyio/go-cursor-rules.git
4+
[submodule "scripts"]
5+
path = scripts
6+
url = git@github.com:hyperifyio/go-scripts.git

scripts

Submodule scripts added at a9772ba

0 commit comments

Comments
 (0)