From 308d2866463a74eedb72c7fedd43ddbfc64609ab Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Tue, 27 Aug 2024 23:17:00 +0100 Subject: [PATCH] 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 --- .forgejo/workflows/workflow.yaml | 27 ++++++++------------------- .golangci.yaml | 2 +- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/.forgejo/workflows/workflow.yaml b/.forgejo/workflows/workflow.yaml index e08ccb4..13935dc 100644 --- a/.forgejo/workflows/workflow.yaml +++ b/.forgejo/workflows/workflow.yaml @@ -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" diff --git a/.golangci.yaml b/.golangci.yaml index 8549273..059f5bc 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -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