chore: setup CI

This commit is contained in:
Romain Bertrand 2025-12-08 09:56:54 +01:00
parent 5b67d39aba
commit 36891e06f4
3 changed files with 98 additions and 0 deletions

56
.gitea/workflows/ci.yml Normal file
View file

@ -0,0 +1,56 @@
name: CI
on:
pull_request:
push:
branches: [ main ]
jobs:
lint:
runs-on: codeberg-small
steps:
- name: Checkout code
uses: https://github.com/actions/checkout@v4
- name: Set up Go
uses: https://github.com/actions/setup-go@v5
with:
go-version: '1.21'
cache: true
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.6.2
- name: Run golangci-lint
run: golangci-lint run --timeout 5m
build:
runs-on: codeberg-small
steps:
- name: Checkout code
uses: https://github.com/actions/checkout@v4
- name: Set up Go
uses: https://github.com/actions/setup-go@v5
with:
go-version: '1.21'
cache: true
- name: Build application
run: make build
test:
runs-on: codeberg-small
steps:
- name: Checkout code
uses: https://github.com/actions/checkout@v4
- name: Set up Go
uses: https://github.com/actions/setup-go@v5
with:
go-version: '1.21'
cache: true
- name: Run tests
run: go test -v -race ./...