Add flag to allow multiple prefix() sections to not be automatically sorted #259
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: gci | |
on: | |
pull_request: | |
jobs: | |
build: | |
name: Build ${{ matrix.target_os }}_${{ matrix.target_arch }} binaries | |
runs-on: ${{ matrix.os }} | |
env: | |
GOVER: 1.21 | |
GOOS: ${{ matrix.target_os }} | |
GOARCH: ${{ matrix.target_arch }} | |
GOPROXY: https://proxy.golang.org | |
ARCHIVE_OUTDIR: dist/archives | |
TEST_OUTPUT_FILE_PREFIX: test_report | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-2019, macOS-latest] | |
target_arch: [arm, arm64, amd64] | |
include: | |
- os: ubuntu-latest | |
target_os: linux | |
- os: windows-2019 | |
target_os: windows | |
- os: macOS-latest | |
target_os: darwin | |
exclude: | |
- os: windows-2019 | |
target_arch: arm | |
- os: windows-2019 | |
target_arch: arm64 | |
- os: macOS-latest | |
target_arch: arm | |
steps: | |
- name: Set up Go ${{ env.GOVER }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GOVER }} | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Cache Go modules (Linux) | |
if: matrix.target_os == 'linux' | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}-build-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}-build- | |
- name: Cache Go modules (Windows) | |
if: matrix.target_os == 'windows' | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~\AppData\Local\go-build | |
~\go\pkg\mod | |
key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}-build-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}-build- | |
- name: Cache Go modules (macOS) | |
if: matrix.target_os == 'darwin' | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/Library/Caches/go-build | |
~/go/pkg/mod | |
key: ${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}-build-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ matrix.target_os }}-${{ matrix.target_arch }}-go-${{ env.GOVER }}-build- | |
- name: golangci-lint | |
if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux' | |
uses: golangci/golangci-lint-action@v4 | |
with: | |
version: ${{ env.GOLANGCILINT_VER }} | |
- name: Run make test | |
env: | |
COVERAGE_OPTS: "-coverprofile=coverage.txt -covermode=atomic" | |
if: matrix.target_arch == 'amd64' | |
run: make test | |