5753be5613
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
36 lines
859 B
YAML
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
- 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 ./...
|