From ba61079b4692e3e023efad228a4da8dd2df78501 Mon Sep 17 00:00:00 2001 From: aibuddy Date: Tue, 19 Aug 2025 16:52:28 +0000 Subject: [PATCH 1/2] scripts+ci: introduce scripts submodule and CI workflow --- .github/workflows/ci.yml | 109 +++++++++++++++++++++++++++++++++++++++ .gitmodules | 6 +++ scripts | 1 + 3 files changed, 116 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .gitmodules create mode 160000 scripts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e6a24bf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,109 @@ +name: CI + +on: + push: + branches: [ develop, main, master ] + pull_request: + branches: [ '**' ] + +permissions: + contents: read + +jobs: + build: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Print Go version + run: go version + + - name: Install ripgrep (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y ripgrep + + - name: Install ripgrep (macOS) + if: runner.os == 'macOS' + run: | + brew update + brew install ripgrep + + - name: Install make and ripgrep (Windows) + if: runner.os == 'Windows' + shell: bash + run: | + choco install -y make ripgrep + echo "make version:"; make --version || true + echo "rg version:"; rg --version || true + + - name: Print Go env + run: go env + + - name: Tidy + shell: bash + run: make tidy + + - name: lint (includes check-go-version) + shell: bash + run: | + set -o pipefail + make lint 2>&1 | tee lint.log + + - name: Assert lint order (check-go-version before golangci-lint) + shell: bash + run: | + test -f lint.log || { echo "lint.log missing"; exit 1; } + L_CHECK=$(rg -n "^check-go-version: OK" -N lint.log | head -1 | cut -d: -f1) + L_GCL=$(rg -n "^golangci-lint version" -N lint.log | head -1 | cut -d: -f1) + if [ -z "$L_CHECK" ]; then echo "Missing 'check-go-version: OK' line in lint.log"; exit 1; fi + if [ -z "$L_GCL" ]; then echo "Missing 'golangci-lint version' line in lint.log"; exit 1; fi + if [ "$L_CHECK" -ge "$L_GCL" ]; then + echo "Ordering incorrect: 'check-go-version: OK' occurs at line $L_CHECK, after golangci-lint version at line $L_GCL"; exit 1; + fi + echo "Lint order OK: check-go-version runs before golangci-lint" + + - name: Upload lint.log artifact + uses: actions/upload-artifact@v4 + with: + name: lint-${{ matrix.os }} + path: lint.log + if-no-files-found: error + + - name: Tools path hygiene + shell: bash + run: make check-tools-paths + + - name: Verify tools manifest commands + shell: bash + run: make verify-manifest-paths + + - name: Test + shell: bash + run: make test + + - name: Test clean-logs guard + shell: bash + run: make test-clean-logs + + - name: Build + shell: bash + run: make build + + - name: Build tools + shell: bash + run: make build-tools diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..559a2e9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule ".cursor/rules"] + path = .cursor/rules + url = git@github.com:hyperifyio/go-cursor-rules.git +[submodule "scripts"] + path = scripts + url = git@github.com:hyperifyio/go-scripts.git diff --git a/scripts b/scripts new file mode 160000 index 0000000..a9772ba --- /dev/null +++ b/scripts @@ -0,0 +1 @@ +Subproject commit a9772ba12c875746c01762c5f024fb478c2cd931 From 43be372d29b599e037e9257faa4ab664774a938d Mon Sep 17 00:00:00 2001 From: aibuddy Date: Wed, 20 Aug 2025 20:27:35 +0000 Subject: [PATCH 2/2] scripts PR: remove CI workflow; moved to separate PR #57 per admin feedback --- .github/workflows/ci.yml | 109 --------------------------------------- 1 file changed, 109 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e6a24bf..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: CI - -on: - push: - branches: [ develop, main, master ] - pull_request: - branches: [ '**' ] - -permissions: - contents: read - -jobs: - build: - name: ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - cache: true - - - name: Print Go version - run: go version - - - name: Install ripgrep (Linux) - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y ripgrep - - - name: Install ripgrep (macOS) - if: runner.os == 'macOS' - run: | - brew update - brew install ripgrep - - - name: Install make and ripgrep (Windows) - if: runner.os == 'Windows' - shell: bash - run: | - choco install -y make ripgrep - echo "make version:"; make --version || true - echo "rg version:"; rg --version || true - - - name: Print Go env - run: go env - - - name: Tidy - shell: bash - run: make tidy - - - name: lint (includes check-go-version) - shell: bash - run: | - set -o pipefail - make lint 2>&1 | tee lint.log - - - name: Assert lint order (check-go-version before golangci-lint) - shell: bash - run: | - test -f lint.log || { echo "lint.log missing"; exit 1; } - L_CHECK=$(rg -n "^check-go-version: OK" -N lint.log | head -1 | cut -d: -f1) - L_GCL=$(rg -n "^golangci-lint version" -N lint.log | head -1 | cut -d: -f1) - if [ -z "$L_CHECK" ]; then echo "Missing 'check-go-version: OK' line in lint.log"; exit 1; fi - if [ -z "$L_GCL" ]; then echo "Missing 'golangci-lint version' line in lint.log"; exit 1; fi - if [ "$L_CHECK" -ge "$L_GCL" ]; then - echo "Ordering incorrect: 'check-go-version: OK' occurs at line $L_CHECK, after golangci-lint version at line $L_GCL"; exit 1; - fi - echo "Lint order OK: check-go-version runs before golangci-lint" - - - name: Upload lint.log artifact - uses: actions/upload-artifact@v4 - with: - name: lint-${{ matrix.os }} - path: lint.log - if-no-files-found: error - - - name: Tools path hygiene - shell: bash - run: make check-tools-paths - - - name: Verify tools manifest commands - shell: bash - run: make verify-manifest-paths - - - name: Test - shell: bash - run: make test - - - name: Test clean-logs guard - shell: bash - run: make test-clean-logs - - - name: Build - shell: bash - run: make build - - - name: Build tools - shell: bash - run: make build-tools