From 2ced3d65a90f7e88fdf7e8fa36df7ddea426856f Mon Sep 17 00:00:00 2001 From: Andy Wu Date: Mon, 7 Oct 2024 15:30:32 -0700 Subject: [PATCH] [fix] go-testing workflow --- .github/workflows/go.yml | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 844cfb5d2..598004630 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,24 +1,40 @@ -name: i386 linux tests +name: Go tests on: push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] + branches: [ main ] workflow_dispatch: jobs: build: - runs-on: self-hosted + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 + - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v5 with: go-version: 1.21.4 - cache: false + cache: 'mod' + + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-mod-cache-${{ hashFiles('**/go.mod', '**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-mod-cache-latest + + - name: Install dependencies + run: | + go mod download + - name: Run tests run: go test -short ./... env: GOOS: linux - GOARCH: 386 + GOARCH: amd64