Skip to content

Commit 849f9d5

Browse files
authored
Merge pull request #79 from nspcc-dev/workflow-update
Workflow update
2 parents 540f9dd + b216917 commit 849f9d5

File tree

1 file changed

+105
-3
lines changed

1 file changed

+105
-3
lines changed

.github/workflows/go.yml

Lines changed: 105 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313
lint:
1414
name: Lint
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-22.04
1616
steps:
1717
- name: Check out code
1818
uses: actions/checkout@v4
@@ -30,10 +30,112 @@ jobs:
3030

3131
tests:
3232
name: Tests
33-
runs-on: ubuntu-20.04
33+
runs-on: ${{ matrix.os }}
3434
strategy:
3535
matrix:
36-
go_versions: [ '1.20', '1.21', '1.22' ]
36+
os: [ubuntu-22.04, windows-2022, macos-12, macos-14]
37+
go: [ '1.20', '1.21', '1.22' ]
38+
exclude:
39+
# Only latest Go version for Windows and MacOS.
40+
- os: windows-2022
41+
go: '1.20'
42+
- os: windows-2022
43+
go: '1.21'
44+
- os: macos-12
45+
go: '1.20'
46+
- os: macos-12
47+
go: '1.21'
48+
- os: macos-14
49+
go: '1.20'
50+
- os: macos-14
51+
go: '1.21'
52+
# Exclude latest Go version for Ubuntu as Coverage uses it.
53+
- os: ubuntu-22.04
54+
go: '1.22'
3755
fail-fast: false
56+
steps:
57+
- name: Setup go
58+
uses: actions/setup-go@v5
59+
with:
60+
cache: true
61+
go-version: ${{ matrix.go }}
62+
63+
- name: Check out code
64+
uses: actions/checkout@v4
65+
66+
- name: Run go test
67+
run: go test -race ./...
68+
69+
cover:
70+
name: Coverage
71+
runs-on: ubuntu-22.04
72+
73+
env:
74+
CGO_ENABLED: 1
3875
steps:
3976
- uses: actions/checkout@v4
77+
with:
78+
fetch-depth: 0
79+
80+
- name: Set up Go
81+
uses: actions/setup-go@v5
82+
with:
83+
cache: true
84+
go-version: 1.22
85+
86+
- name: Test and write coverage profile
87+
run: go test -coverprofile=coverage.txt -covermode=atomic ./...
88+
89+
- name: Upload coverage results to Codecov
90+
uses: codecov/codecov-action@v4
91+
with:
92+
token: ${{ secrets.CODECOV_TOKEN }}
93+
slug: nspcc-dev/xk6-neofs
94+
fail_ci_if_error: true
95+
files: ./coverage.txt
96+
verbose: true
97+
98+
codeql:
99+
name: CodeQL
100+
runs-on: ubuntu-latest
101+
102+
strategy:
103+
fail-fast: false
104+
matrix:
105+
language: [ 'go' ]
106+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
107+
# Learn more:
108+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
109+
110+
steps:
111+
- name: Checkout repository
112+
uses: actions/checkout@v4
113+
114+
# Initializes the CodeQL tools for scanning.
115+
- name: Initialize CodeQL
116+
uses: github/codeql-action/init@v2
117+
with:
118+
languages: ${{ matrix.language }}
119+
# If you wish to specify custom queries, you can do so here or in a config file.
120+
# By default, queries listed here will override any specified in a config file.
121+
# Prefix the list here with "+" to use these queries and those in the config file.
122+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
123+
124+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
125+
# If this step fails, then you should remove it and run the build manually (see below)
126+
- name: Autobuild
127+
uses: github/codeql-action/autobuild@v2
128+
129+
# ℹ️ Command-line programs to run using the OS shell.
130+
# 📚 https://git.io/JvXDl
131+
132+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
133+
# and modify them (or add more) to build your code if your project
134+
# uses a compiled language
135+
136+
#- run: |
137+
# make bootstrap
138+
# make release
139+
140+
- name: Perform CodeQL Analysis
141+
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)