43 lines
689 B
YAML
43 lines
689 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
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-file: go.mod
|
|
cache: true
|
|
|
|
- name: Format check
|
|
run: test -z "$(gofmt -l .)"
|
|
|
|
- name: Test
|
|
run: go test ./...
|
|
|
|
- name: Build
|
|
run: go build ./...
|
|
|
|
docker:
|
|
name: Docker build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build image
|
|
run: docker build .
|