CI: disable CGO_ENABLED on cross build (release) #44
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set up Go 1.21 | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.21 | |
check-latest: true | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check version | |
run: DEBUG=true ./ci/version | |
- name: Test | |
run: make test | |
- name: Build | |
run: make build | |
- name: Print theo-agent -version | |
run: ./build/theo-agent -version | |
- name: Cross build | |
env: | |
CGO_ENABLED: 0 | |
run: | | |
GOOS=linux GOARCH=amd64 make -e buildx | |
- name: Upload theo-agent | |
uses: actions/upload-artifact@v3 | |
with: | |
name: theo-agent-Linux-x86_64 | |
path: build/theo-agent-Linux-x86_64 | |
test-build: | |
name: Test artifact on 20.04 | |
needs: build | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Download theo-agent | |
uses: actions/download-artifact@v3 | |
with: | |
name: theo-agent-Linux-x86_64 | |
- name: Add execution bit to downloaded file | |
run: chmod +x ./theo-agent-Linux-x86_64 | |
- name: Print theo-agent -version | |
run: ./theo-agent-Linux-x86_64 -version |