Skip to content

Improve workflow speed & build binaries #381

Improve workflow speed & build binaries

Improve workflow speed & build binaries #381

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout=5m
build-test:
name: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install just
uses: taiki-e/install-action@just
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build and run tests with race detector enabled
run: just test-race
build:
name: Build and Publish
runs-on: ubuntu-latest
# if: github.event_name != 'pull_request'
strategy:
matrix:
goos: [linux, darwin]
goarch: [amd64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
run: |
mkdir -p dist
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o dist/cofidectl-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/cofidectl/main.go
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: cofidectl-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/cofidectl-${{ matrix.goos }}-${{ matrix.goarch }}