Files
docker-state-exporter/.github/workflows/build.yml
T
renovate[bot] 51970d3181 Update actions/cache action to v5 (#29)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-06 13:56:03 +00:00

36 lines
859 B
YAML

name: Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-go@v5
with:
go-version: "1.26"
- name: Cache Go modules
id: cache-go
uses: actions/cache@v5
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go modules
shell: bash
if: ${{ steps.cache-go.outputs.cache-hit != 'true' }}
run: go mod download
- name: Go build
shell: bash
run: go build ./...
- name: Go test
shell: bash
run: go test ./...