run go generate #2
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
permissions: | |
contents: read | |
env: | |
earthly_version: ^0.7.19 | |
jobs: | |
go-mod: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
- run: go mod tidy | |
- name: Check go.mod and go.sum | |
run: git diff --exit-code -- go.mod go.sum | |
go-generate: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: earthly/actions-setup@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
version: ${{ env.earthly_version }} | |
- run: earthly +generate | |
- name: Check diff | |
run: git diff --exit-code | |
go-build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
go-env: | |
- name: amd64 | |
env: GOOS=linux GOARCH=amd64 | |
- name: arm64 | |
env: GOOS=linux GOARCH=arm64 | |
- name: armv7 | |
env: GOOS=linux GOARCH=arm GOARM=7 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
- name: Build | |
run: CGO_ENABLED=0 ${{ matrix.go-env.env }} go build -o out/ | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.go-env.name }} | |
path: out/**/* |