This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
Build for macOS with ubuntu runner, support 64-bit ARM architecture on Windows and Linux #559
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: CI | |
on: | |
push: | |
branches: | |
- main | |
tags-ignore: | |
- '**' | |
pull_request: | |
jobs: | |
static-analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go | |
- id: tool-versions | |
run: awk '{ print $1"="$2 }' .tool-versions >> $GITHUB_OUTPUT | |
shell: bash | |
- uses: golangci/golangci-lint-action@v3 | |
with: | |
skip-pkg-cache: true | |
skip-build-cache: true | |
version: v${{ steps.tool-versions.outputs.golangci-lint }} | |
go-mod-tidy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go | |
- name: go mod tidy | |
run: | | |
go mod tidy | |
git diff --exit-code | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go | |
- name: Install gotestsum | |
run: go install gotest.tools/gotestsum@latest | |
- name: Test | |
run: make test | |
validate-renovate-config: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Validate Renovate config | |
run: npx --package renovate renovate-config-validator | |
package: | |
needs: [static-analysis, go-mod-tidy, test] | |
# Run the build on macOS, because only the macOS version is built with CGO enabled. | |
# See https://github.com/golang/go/issues/12524 | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go | |
- id: tool-versions | |
run: awk '{ print $1"="$2 }' .tool-versions >> $GITHUB_OUTPUT | |
shell: bash | |
- uses: goreleaser/goreleaser-action@v4 | |
with: | |
version: "v${{ steps.tool-versions.outputs.goreleaser }}" | |
install-only: true | |
- name: Package binaries | |
run: make package | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist |