fix(ci): modernize on-push build.yml to use actions/setup-go@1.24 + cache + go mod download (fixes Go 1.22.5 vs go.mod 1.24.2 mismatch); keep 'Linux Build' step name for compatibility; update ci-build.sh
Some checks failed
CI / Build (push) Blocked by required conditions
CI / Test (push) Has been cancelled

This commit is contained in:
Greg Gauthier 2026-06-06 08:03:26 +01:00
parent 6a3e1e8b53
commit a9766ef360
2 changed files with 60 additions and 22 deletions

View File

@ -1,26 +1,62 @@
name: gobuild
name: CI
on: [push]
env:
BUILD_TYPE: Release
on: [push, pull_request]
jobs:
build:
runs-on: golang-latest
test:
name: Test
runs-on: ubuntu-gitea
steps:
- name: Lets See What We Have
run:
uname -a
&& echo $PATH
&& echo $GOPATH
&& which go
&& go version
- name: Clone Repo
run:
git clone https://repos.gmgauthier.com/gmgauthier/gostations.git .
&& ls -la
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- 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: make test-short
build:
name: Build
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'
- 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:
./ci-build.sh
run: ./ci-build.sh
- name: Verify binary
run: |
./build/gostations -v || true
ls -lh build/gostations || true

View File

@ -1,7 +1,9 @@
#!/usr/bin/env sh
# CI build (old runner compatibility). Uses Makefile for consistency.
# CI build step (kept for the workflow's "Linux Build" name).
# Now uses modern Go from setup-go in the workflow.
set -e
echo "Running make build with Go: $(go version)"
make build