Files
docker-state-exporter/.github/workflows/build.yml
T
2026-04-01 06:00:45 +00:00

31 lines
761 B
YAML

name: Build and Test
on:
push:
pull-request:
- opened
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
container:
image: golang:1.23-alpine
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Cache Go modules
id: cache-go
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go modules
if: ${{ steps.cache-go.outputs.cache-hit != 'true' }}
run: go mod download
- name: Go build
run: go build ./...
- name: Go test
run: go test ./...