aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/checks.yaml
blob: c406d98f9bd0c35db27f9e510b9d676b90c7e40f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 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@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