test go codes on GHA
This commit is contained in:
@@ -9,10 +9,11 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: golang:1.23-alpine
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: "1.26"
|
||||||
- name: Cache Go modules
|
- name: Cache Go modules
|
||||||
id: cache-go
|
id: cache-go
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -22,9 +23,12 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-go-
|
${{ runner.os }}-go-
|
||||||
- name: Download Go modules
|
- name: Download Go modules
|
||||||
|
shell: bash
|
||||||
if: ${{ steps.cache-go.outputs.cache-hit != 'true' }}
|
if: ${{ steps.cache-go.outputs.cache-hit != 'true' }}
|
||||||
run: go mod download
|
run: go mod download
|
||||||
- name: Go build
|
- name: Go build
|
||||||
|
shell: bash
|
||||||
run: go build ./...
|
run: go build ./...
|
||||||
- name: Go test
|
- name: Go test
|
||||||
|
shell: bash
|
||||||
run: go test ./...
|
run: go test ./...
|
||||||
|
|||||||
Reference in New Issue
Block a user