ci: replace setup-go action with manual Go install from go.dev
actions/setup-go@v5 was failing silently (0s steps) likely due to network issues downloading Go from GitHub. Install Go directly from go.dev which is more accessible. Also remove Docker job (not needed yet) and simplify to 3 jobs.
This commit is contained in:
parent
ff602ee183
commit
bb0f321849
@ -17,10 +17,12 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
- name: Install Go
|
||||
run: |
|
||||
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
|
||||
curl -sL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf -
|
||||
echo "/usr/local/go/bin" >> $GITHUB_PATH
|
||||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Check formatting
|
||||
run: |
|
||||
@ -43,10 +45,11 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
- name: Install Go
|
||||
run: |
|
||||
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
|
||||
curl -sL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf -
|
||||
echo "/usr/local/go/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Run unit tests
|
||||
run: go test -race -count=1 ./internal/...
|
||||
@ -60,26 +63,14 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
- name: Install Go
|
||||
run: |
|
||||
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
|
||||
curl -sL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf -
|
||||
echo "/usr/local/go/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Build
|
||||
run: make build
|
||||
|
||||
- name: Verify binary
|
||||
run: ./bin/lolly --help
|
||||
|
||||
docker:
|
||||
name: Docker
|
||||
needs: build
|
||||
if: github.event_name == 'push'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build -t lolly:latest .
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user