aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2026-05-03 20:57:15 +0200
committerStefan Majewsky <majewsky@gmx.net>2026-05-03 21:01:00 +0200
commit5e47f483cf08edd619012ba7762449954c81117d (patch)
treebaf8a7842596c8b2a249ed0a5b76d4d78ef5945a /.github
parent31513796b0057e4d7e623a22e664b3557bbe54a3 (diff)
downloadgo-oblast-5e47f483cf08edd619012ba7762449954c81117d.tar.gz
run tests when a PR is posted on GitHub
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/checks.yaml68
1 files changed, 68 insertions, 0 deletions
diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml
new file mode 100644
index 0000000..3b2c9a8
--- /dev/null
+++ b/.github/workflows/checks.yaml
@@ -0,0 +1,68 @@
+# SPDX-FileCopyrightText: 2025 Stefan Majewsky <majewsky@gmx.net>
+# 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@v6
+ - name: Set up Go
+ uses: actions/setup-go@v6
+ with:
+ check-latest: true
+ go-version: stable
+
+ ####################
+ # Static Tests
+
+ - name: Run golangci-lint
+ uses: golangci/golangci-lint-action@v9
+ with:
+ version: latest
+ - name: REUSE Compliance Check
+ uses: fsfe/reuse-action@v6
+
+ ####################
+ # Test Suite
+
+ - name: Run tests
+ run: mkdir -p build && go test -shuffle=on -coverprofile=build/cover.out -covermode=count ./...
+ - name: Archive code coverage results
+ uses: actions/upload-artifact@v7
+ with:
+ name: code-coverage
+ path: build/cover.out
+
+ code_coverage:
+ name: Code coverage report
+ if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
+ needs: [ checks ]
+ runs-on: ubuntu-latest
+ permissions:
+ actions: read
+ contents: read
+ pull-requests: write
+ steps:
+ - name: Check out code
+ uses: actions/checkout@v6
+ - name: Post coverage report
+ uses: fgrosse/go-coverage-report@v1.3.0
+ with:
+ coverage-artifact-name: code-coverage
+ coverage-file-name: cover.out