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
This commit is contained in:
parent
6a3e1e8b53
commit
a9766ef360
@ -1,26 +1,62 @@
|
|||||||
name: gobuild
|
name: CI
|
||||||
|
|
||||||
on: [push]
|
on: [push, pull_request]
|
||||||
|
|
||||||
env:
|
|
||||||
BUILD_TYPE: Release
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
test:
|
||||||
runs-on: golang-latest
|
name: Test
|
||||||
|
runs-on: ubuntu-gitea
|
||||||
steps:
|
steps:
|
||||||
- name: Lets See What We Have
|
- name: Checkout code
|
||||||
run:
|
uses: actions/checkout@v4
|
||||||
uname -a
|
|
||||||
&& echo $PATH
|
- name: Set up Go
|
||||||
&& echo $GOPATH
|
uses: actions/setup-go@v5
|
||||||
&& which go
|
with:
|
||||||
&& go version
|
go-version: '1.24'
|
||||||
- name: Clone Repo
|
|
||||||
run:
|
- name: Cache Go modules
|
||||||
git clone https://repos.gmgauthier.com/gmgauthier/gostations.git .
|
uses: actions/cache@v4
|
||||||
&& ls -la
|
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
|
- name: Linux Build
|
||||||
run:
|
run: ./ci-build.sh
|
||||||
./ci-build.sh
|
|
||||||
|
- name: Verify binary
|
||||||
|
run: |
|
||||||
|
./build/gostations -v || true
|
||||||
|
ls -lh build/gostations || true
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#!/usr/bin/env sh
|
#!/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
|
set -e
|
||||||
|
|
||||||
|
echo "Running make build with Go: $(go version)"
|
||||||
make build
|
make build
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user