Skip to content

Refactor: logging and output system cleanup #137

Refactor: logging and output system cleanup

Refactor: logging and output system cleanup #137

Workflow file for this run

name: CI
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24.4"
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Staticcheck
run: go run honnef.co/go/tools/cmd/staticcheck@latest ./...
- name: Run tests
run: go test ./...
build:
name: Build on ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: amd64
goos: linux
goarch: amd64
- os: ubuntu-latest
arch: arm64
goos: linux
goarch: arm64
- os: windows-latest
arch: amd64
goos: windows
goarch: amd64
- os: windows-latest
arch: arm64
goos: windows
goarch: arm64
- os: macos-latest
arch: amd64
goos: darwin
goarch: amd64
- os: macos-latest
arch: arm64
goos: darwin
goarch: arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24.4"
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Build
run: |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=0 go build -o fontget-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }} .
shell: bash
- name: Verify binary
run: |
# Only verify binaries that match the runner's architecture
# ARM64 binaries can't run on x86_64 runners, so we just verify they exist
if [ "${{ matrix.goarch }}" = "arm64" ]; then
# For ARM64, just verify the binary exists and has reasonable size
if [ "${{ matrix.goos }}" = "windows" ]; then
if [ -f "./fontget-${{ matrix.goos }}-${{ matrix.goarch }}.exe" ]; then
ls -lh ./fontget-${{ matrix.goos }}-${{ matrix.goarch }}.exe
echo "✓ ARM64 Windows binary created successfully"
else
echo "✗ ARM64 Windows binary not found"
exit 1
fi
else
if [ -f "./fontget-${{ matrix.goos }}-${{ matrix.goarch }}" ]; then
ls -lh ./fontget-${{ matrix.goos }}-${{ matrix.goarch }}
echo "✓ ARM64 ${{ matrix.goos }} binary created successfully"
else
echo "✗ ARM64 ${{ matrix.goos }} binary not found"
exit 1
fi
fi
else
# For amd64, we can actually run the binary to verify it works
if [ "${{ matrix.goos }}" = "windows" ]; then
./fontget-${{ matrix.goos }}-${{ matrix.goarch }}.exe version
else
./fontget-${{ matrix.goos }}-${{ matrix.goarch }} version
fi
fi
shell: bash