Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
vet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- run: go vet ./...
- name: gofmt
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "Run gofmt -w on:"; echo "$unformatted"; exit 1
fi

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- uses: golangci/golangci-lint-action@v9
with:
version: v2.14.0

test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: logengine
POSTGRES_PASSWORD: logengine
POSTGRES_DB: logengine
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U logengine"
--health-interval 2s
--health-timeout 5s
--health-retries 15
env:
PGTEST_DATABASE_URL: postgres://logengine:logengine@localhost:5432/logengine?sslmode=disable
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- run: go test -race ./...

docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: docker/setup-buildx-action@v4
# No QEMU: the build stage runs on $BUILDPLATFORM and cross-compiles,
# and the runtime stage has no RUN steps.
- uses: docker/build-push-action@v7
with:
context: .
file: deploy/docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
Loading
Loading