Skip to content

Commit

Permalink
Update setup-go to be able to cache (Boeing#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
u5surf authored and shiina4119 committed Aug 23, 2024
1 parent e976393 commit ca39993
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,27 @@ on:

jobs:

download:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21

- name: Download
run: go mod download

lint:
needs: download
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.21

Expand All @@ -30,25 +44,27 @@ jobs:
run: if [ "$(gofmt -s -l -e . | wc -l)" -gt 0 ]; then exit 1; fi

build:
needs: download
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.21

- name: Build
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags='-w -s -extldflags "-static"' -tags netgo -o validator cmd/validator/validator.go

test:
needs: download
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.21

Expand Down

0 comments on commit ca39993

Please sign in to comment.