workflows: reuse org-wide linter workflow #37
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '*.md' | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- '*.md' | |
jobs: | |
test: | |
name: Tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-24.04, windows-2022, macos-14] | |
go: [ '1.22', '1.23' ] | |
exclude: | |
# Only latest Go version for Windows and MacOS. | |
- os: windows-2022 | |
go: '1.22' | |
- os: macos-14 | |
go: '1.22' | |
# Exclude latest Go version for Ubuntu as Coverage uses it. | |
- os: ubuntu-24.04 | |
go: '1.23' | |
fail-fast: false | |
steps: | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
cache: true | |
go-version: ${{ matrix.go }} | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Run go test | |
run: go test -race ./... | |
cover: | |
name: Coverage | |
runs-on: ubuntu-24.04 | |
env: | |
CGO_ENABLED: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
cache: true | |
go-version: 1.23 | |
- name: Test and write coverage profile | |
run: go test -coverprofile=coverage.txt -covermode=atomic ./... | |
- name: Upload coverage results to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: nspcc-dev/hrw | |
fail_ci_if_error: true | |
files: ./coverage.txt | |
verbose: true | |
lint: | |
name: Lint | |
uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master | |
codeql: | |
name: CodeQL | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
language: [ 'go' ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: ${{ matrix.language }} | |
- name: Autobuild | |
uses: github/codeql-action/autobuild@v2 | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 |