test go codes on GHA

This commit is contained in:
Ruins
2026-04-01 06:00:54 +00:00
parent 931aebc7bf
commit 4f8894c249
+6 -2
View File
@@ -9,10 +9,11 @@ on:
jobs:
build-and-test:
runs-on: ubuntu-latest
container:
image: golang:1.23-alpine
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-go@v5
with:
go-version: "1.26"
- name: Cache Go modules
id: cache-go
uses: actions/cache@v4
@@ -22,9 +23,12 @@ jobs:
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 ./...