- ci-build.sh for parity with gostations (Linux Build step in workflow) - scripts/gralculator-install.sh and .ps1 modeled directly on gostations (platform detection, download, checksum verify with sha256sum/shasum, extract, install to ~/.local/bin, versioned) - Updated build.yml: Linux Build now calls ./ci-build.sh; added lint job (golangci-lint-action@v7 v2.1.6 like grokkit) after test, build now needs [test, lint] - release.yml already prepared to include the scripts if present - All modeled closely on gostations/grokkit for consistency
87 lines
2.0 KiB
YAML
87 lines
2.0 KiB
YAML
name: CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-gitea
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24.2'
|
|
|
|
- name: Cache Go modules
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Download dependencies
|
|
run: go mod download
|
|
|
|
- name: Run tests (short)
|
|
run: |
|
|
go mod tidy
|
|
make test-short
|
|
# go mod tidy ensures go.sum is complete (fixes "missing go.sum entry" for deps during `go test`)
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-gitea
|
|
needs: [test]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24.2'
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v7
|
|
with:
|
|
version: v2.1.6
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-gitea
|
|
needs: [test, lint]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24.2'
|
|
|
|
- name: Cache Go modules
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Download dependencies
|
|
run: go mod download
|
|
|
|
- name: Linux Build
|
|
run: |
|
|
go mod tidy
|
|
./ci-build.sh
|
|
# go mod tidy ensures go.sum is fully populated for this Go version before the make build / go build (ci-build.sh just wraps make build for workflow naming parity with gostations)
|
|
|
|
- name: Verify binary
|
|
run: |
|
|
./build/gralculator -v || true
|
|
ls -lh build/gralculator || true
|