chore: update project template

- workflow: run the test job only when the PR is not in the draft state.
- workflow: use the remote mage-ci action to run the tests via mage.
- workflow: remove the lint job for now. In the future it may be
  replaced by a step.
- lint: update .golangci.yaml
This commit is contained in:
Dan Anglin 2024-08-27 23:17:00 +01:00
parent 4fd8e37f68
commit 308d286646
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
2 changed files with 9 additions and 20 deletions

View file

@ -1,13 +1,15 @@
---
name: Workflow
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
test:
if: ${{ ! github.event.pull_request.draft }}
runs-on: docker
env:
GO_TEST_VERBOSE: "1"
@ -15,23 +17,10 @@ jobs:
steps:
- name: Checkout Repository
uses: https://code.forgejo.org/actions/checkout@v4
- name: Setup Go
uses: https://code.forgejo.org/actions/setup-go@v5
with:
go-version: '1.22'
- name: Test
run: go run magefiles/main.go -v test
lint:
runs-on: docker
steps:
- name: Checkout Repository
uses: https://code.forgejo.org/actions/checkout@v4
- name: Setup Go
uses: https://code.forgejo.org/actions/setup-go@v5
uses: https://codeflow.dananglin.me.uk/actions/mage-ci@main
with:
go-version: '1.22'
- name: Lint
uses: https://github.com/golangci/golangci-lint-action@v3
with:
version: v1.54
target: test
env:
PROJECT_TEST_VERBOSE: "1"
PROJECT_TEST_COVER: "1"

View file

@ -6,7 +6,7 @@ run:
tests: true
output:
format: colored-line-number
formats: colored-line-number
print-issues-lines: true
print-linter-name: true
uniq-by-line: true