From 22d78bbb8d417325d8122139d62fea8c52a996ed Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Tue, 1 Jul 2025 11:22:19 +0200 Subject: add golangci-lint config --- .github/workflows/checks.yaml | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/checks.yaml (limited to '.github') diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml new file mode 100644 index 0000000..c406d98 --- /dev/null +++ b/.github/workflows/checks.yaml @@ -0,0 +1,50 @@ +# SPDX-FileCopyrightText: 2025 Stefan Majewsky +# SPDX-License-Identifier: Apache-2.0 + +name: Checks +"on": + push: + branches: [ main ] + pull_request: + branches: [ '*' ] + workflow_dispatch: {} +permissions: + checks: write + contents: read +jobs: + checks: + name: Checks + runs-on: ubuntu-latest + steps: + + #################### + ### Setup Phase + + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + check-latest: true + go-version: stable + + #################### + # Static Tests + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v8 + with: + version: latest + + #################### + # Test Suite + + - name: Run tests + run: go test -shuffle=on -coverprofile=cover.out -covermode=count ./... + - name: Upload coverage report to Coveralls + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIT_BRANCH: ${{ github.head_ref }} + run: | + go install github.com/mattn/goveralls@latest + goveralls -service=github -coverprofile=cover.out -- cgit v1.2.3