From 31314c3a13e836fa4c4cf2fc4cc11b9732748e85 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Fri, 16 Feb 2024 14:16:26 +0000 Subject: [PATCH] Use make targets in CI --- .github/workflows/checks.yml | 43 +++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6aaa038b..ad8f8600 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -39,10 +39,23 @@ jobs: run: | go test ./... -race - fmt_and_vet: - name: "fmt and lint" + copyright: + name: "copyright headers" runs-on: ubuntu-latest + steps: + - name: "Fetch source code" + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - name: Install Go + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 + with: + go-version-file: go.mod + - name: "go vet" + run: | + make copyrightcheck + govet: + name: "go vet" + runs-on: ubuntu-latest steps: - name: "Fetch source code" uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 @@ -50,16 +63,20 @@ jobs: uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: go-version-file: go.mod - - name: "Check vet" + - name: "go vet" run: | - go vet ./... - - name: "Check fmt" + make vetcheck + + gofmt: + name: "gofmt" + runs-on: ubuntu-latest + steps: + - name: "Fetch source code" + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - name: Install Go + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 + with: + go-version-file: go.mod + - name: "gofmt" run: | - go fmt ./... - if [[ -z "$(git status --porcelain)" ]]; then - echo "Formatting is consistent with 'go fmt'." - else - echo "Run 'go fmt ./...' to automatically apply standard Go style to all packages." - git status --porcelain - exit 1 - fi + make fmtcheck