Skip to content

feat(cli): Colour the retry line yellow rather than dimming it #129

feat(cli): Colour the retry line yellow rather than dimming it

feat(cli): Colour the retry line yellow rather than dimming it #129

Workflow file for this run

name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: read
jobs:
# Static analysis reaches the same verdict on every platform, so it runs
# once. Spreading it across the matrix would multiply the slowest checks --
# gosec and golangci-lint -- for output that cannot differ.
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Install just
uses: extractions/setup-just@v4
# The pin in go.mod cannot upgrade itself, and every Go patch release
# carries security fixes. This reports drift; it does not fail the build,
# because a new Go patch is not a defect in this repository.
- name: Check the pinned Go toolchain is current
run: just toolchain-check
- name: Install golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
# The action lints as well as installs unless told otherwise, and
# `just lint` is about to do exactly that with the repository's own
# configuration. Without this the linter runs twice per build.
install-only: true
- name: Install gosec
run: go install github.com/securego/gosec/v2/cmd/gosec@latest
- name: Run the static checks
run: just static-checks
# The tool ships for five platforms, and it is less OS-neutral than it looks:
# socket timeout behaviour, colon parsing around IPv6 literals, printable-rune
# classification and exit-code handling all differ. Testing only on Linux left
# every other user running a suite that had never executed on their machine.
#
# An empty Go version means "whatever go.mod requires"; 'stable' catches a
# regression on the next Go release rather than whenever go.mod next moves.
test:
name: test (${{ matrix.os }}, go ${{ matrix.go || 'from go.mod' }})
# A vet or lint failure fails every leg identically, so there is no reason
# to occupy six runners finding that out six times.
needs: check
strategy:
# One platform failing must not hide the others; a matrix that stops at
# the first red leg reports one bug per run instead of all of them.
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go: ['', 'stable']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: ${{ matrix.go }}
go-version-file: go.mod
- name: Install just
uses: extractions/setup-just@v4
- name: Run unit tests
run: just test-race
- name: Run end-to-end tests
run: just test-e2e
# The release configuration is otherwise only exercised when a tag is pushed,
# which is the worst moment to discover it is broken. Cross-compiles every
# published target and publishes nothing.
release-snapshot:
# Last, because packaging code that does not pass its tests on every
# platform it is packaged for answers a question nobody asked.
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Build the release artifacts
uses: goreleaser/goreleaser-action@v7
with:
version: '~> v2'
args: build --snapshot --clean