Files
Alexandr Stelnykovych 575d4aa53f ci: pin Go 1.26.x in the Go workflow
'^1.26' resolved to Go 1.27, whose export data golangci-lint v2.12.2 cannot read, so every typecheck failed. Match go.mod and the Earthfile, which use Go 1.26.
2026-11-24 14:11:28 +02:00

72 lines
1.6 KiB
YAML

name: Go
on:
push:
paths:
- '**.go'
- 'cmds/**'
- 'runtime/**'
- 'service/**'
- 'spn/**'
branches:
- main
- development
- v1-legacy
- v1-legacy-develop
pull_request:
paths:
- '**.go'
- 'cmds/**'
- 'runtime/**'
- 'service/**'
- 'spn/**'
branches:
- main
- development
- v1-legacy
- v1-legacy-develop
jobs:
lint:
name: Linter
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Setup Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version: '1.26.x'
cache: false
- name: Run golangci-lint
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
version: v2.12.2
only-new-issues: true
args: -c ./.golangci.yml --timeout 15m
- name: Run go vet
run: go vet ./...
test:
name: Test & Build
runs-on: ubuntu-latest
steps:
- uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1
with:
version: v0.8.0
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run Go Tests & Build
run: earthly --ci --remote-cache=ghcr.io/safing/build-cache --push +go-ci