Skip to content

refactor: modernize Go code with go fix (Go 1.26) #56

refactor: modernize Go code with go fix (Go 1.26)

refactor: modernize Go code with go fix (Go 1.26) #56

Workflow file for this run

name: CLI
on:
workflow_dispatch:
push:
branches: [main, master]
paths:
- "clients/cli/**"
- ".github/workflows/cli.yaml"
pull_request:
branches: [main, master]
paths:
- "clients/cli/**"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
cache-dependency-path: clients/cli/go.sum
- name: Run tests
working-directory: clients/cli
run: go test -v -race -coverprofile=coverage.out ./...
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
files: clients/cli/coverage.out
flags: cli
continue-on-error: true
build:
runs-on: ubuntu-latest
needs: test
strategy:
matrix:
include:
- goos: darwin
goarch: arm64
- goos: darwin
goarch: amd64
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
cache-dependency-path: clients/cli/go.sum
- name: Build
working-directory: clients/cli
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
go build -ldflags="-s -w" -o netclode-${{ matrix.goos }}-${{ matrix.goarch }} .
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: netclode-${{ matrix.goos }}-${{ matrix.goarch }}
path: clients/cli/netclode-${{ matrix.goos }}-${{ matrix.goarch }}
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
cache-dependency-path: clients/cli/go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
working-directory: clients/cli