Skip to content

Merge pull request #9 from bbrowning/update-container-image-name #10

Merge pull request #9 from bbrowning/update-container-image-name

Merge pull request #9 from bbrowning/update-container-image-name #10

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.23"
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.11
- name: Check formatting
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "Files need formatting:"
echo "$unformatted"
exit 1
fi
unit-tests:
name: Unit Tests
runs-on: ubuntu-22.04
needs: lint
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.23"
- name: Run unit tests
run: go test -short -race -coverprofile=coverage.out ./...
- name: Upload coverage
uses: actions/upload-artifact@v7
with:
name: coverage
path: coverage.out
integration-tests:
name: Integration Tests
runs-on: ubuntu-22.04
needs: unit-tests
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.23"
- name: Run integration tests
run: go test -race -run TestIntegration ./...
build:
name: Build (${{ matrix.goarch }})
runs-on: ubuntu-22.04
needs: lint
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.23"
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
run: go build -ldflags="-s -w" -o bin/paude-proxy-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/paude-proxy/
- name: Upload binary
uses: actions/upload-artifact@v7
with:
name: paude-proxy-${{ matrix.goos }}-${{ matrix.goarch }}
path: bin/paude-proxy-${{ matrix.goos }}-${{ matrix.goarch }}
container-build:
name: Container Build
runs-on: ubuntu-22.04
needs: lint
steps:
- uses: actions/checkout@v6
- name: Build container image
run: podman build -t paude-proxy:test .