chore: add support for linting

This commit is contained in:
Emmanuel BENOîT 2024-07-19 20:18:59 +02:00
parent 0290ef59b6
commit 7f0dd549fd
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg
6 changed files with 1176 additions and 31 deletions
.forgejo/workflows

View file

@ -1,30 +0,0 @@
name: Build and test project
on:
push:
branches: [master]
pull-request:
branches: [master]
jobs:
build:
runs-on: debian-12
steps:
-
name: Checkout repo
uses: actions/checkout@v4
-
name: Extract Go version
id: go-version
run: |
sed '/^go /!d; s/go /version=/' go.mod >>"$GITHUB_OUTPUT"
-
name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ steps.go-version.outputs.version }}
-
name: Run tests
run: |
make test

View file

@ -0,0 +1,66 @@
name: Run tests and linters
on:
push:
branches: [master]
pull-request:
branches: [master]
jobs:
test:
runs-on: debian-12
steps:
-
name: Checkout repo
uses: actions/checkout@v4
-
name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
tools/go.sum
-
name: Run tests
run: |
make test
lint:
runs-on: debian-12
steps:
-
name: Checkout repo
uses: actions/checkout@v4
-
name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
tools/go.sum
-
name: Run linters
run: |
make lint
build:
runs-on: debian-12
steps:
-
name: Checkout repo
uses: actions/checkout@v4
-
name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
tools/go.sum
-
name: Run tests
run: |
make test