Skip to content

Commit 22d5f26

Browse files
authored
chore: Migrate to usage of go-tools docker image instead of vendored (#224)
* chore: Migrate to go-tools docker image instead of vendored * ci: Remove tools from dependabot config * ci: Optimize pipeline * docs: Update Readme coverage * chore: Pin gotools image version in makefile * refactor: DRY for compose file and commands
1 parent 1b0352b commit 22d5f26

File tree

6,609 files changed

+226
-1729295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,609 files changed

+226
-1729295
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,6 @@ updates:
1313
commit-message:
1414
prefix: "chore"
1515
include: "scope"
16-
17-
- package-ecosystem: "gomod"
18-
directory: "/tools/"
19-
schedule:
20-
interval: "daily"
21-
labels:
22-
- "dependencies"
23-
assignees:
24-
- "obalunenko"
25-
reviewers:
26-
- "obalunenko"
27-
commit-message:
28-
prefix: "chore"
29-
include: "scope"
3016

3117
- package-ecosystem: "github-actions"
3218
directory: "/"

.github/workflows/codeql-analysis.yml

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,41 +30,29 @@ jobs:
3030
security-events: write
3131

3232
strategy:
33-
fail-fast: false
33+
fail-fast: true
3434
matrix:
3535
language: [ 'go' ]
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3737
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3838

3939
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v3
42-
43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v2
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52-
53-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54-
# If this step fails, then you should remove it and run the build manually (see below)
55-
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v2
57-
58-
# ℹ️ Command-line programs to run using the OS shell.
59-
# 📚 https://git.io/JvXDl
60-
61-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62-
# and modify them (or add more) to build your code if your project
63-
# uses a compiled language
64-
65-
#- run: |
66-
# make bootstrap
67-
# make release
68-
69-
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v2
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
- name: Build
54+
run: |
55+
make build
56+
57+
- name: Perform CodeQL Analysis
58+
uses: github/codeql-action/analyze@v2

.github/workflows/go.yml

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ on:
3434
- '!.github/workflows/readme-stars.yml'
3535

3636
jobs:
37-
testing:
37+
build:
3838
strategy:
3939
fail-fast: false
40-
max-parallel: 2
40+
max-parallel: 3
4141
matrix:
4242
os: [ 'ubuntu-22.04' ]
4343
go: [ '1.19' ]
4444
runs-on: ${{ matrix.os }}
45-
name: Run Tests
45+
name: Build
4646
steps:
4747
- name: Checkout
4848
uses: actions/checkout@v3
@@ -71,26 +71,30 @@ jobs:
7171
restore-keys: |
7272
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/tools/go.sum') }}
7373
74-
- name: Install tools
74+
- name: Build
7575
run: |
76-
make install-tools
76+
make build
7777
shell: bash
7878

79-
- name: Test
79+
- name: Install GoReleaser
80+
uses: goreleaser/goreleaser-action@v3
81+
with:
82+
install-only: true
83+
84+
- name: Check release
8085
run: |
81-
make test
86+
make check-releaser
8287
shell: bash
8388

84-
linting:
85-
needs: testing
89+
testing:
8690
strategy:
8791
fail-fast: false
8892
max-parallel: 2
8993
matrix:
9094
os: [ 'ubuntu-22.04' ]
9195
go: [ '1.19' ]
9296
runs-on: ${{ matrix.os }}
93-
name: Run linters
97+
name: Run Tests
9498
steps:
9599
- name: Checkout
96100
uses: actions/checkout@v3
@@ -101,15 +105,11 @@ jobs:
101105
uses: actions/setup-go@v3.4.0
102106
with:
103107
go-version: ${{ matrix.go }}
108+
104109
- run: |
105110
go version
106111
shell: bash
107112
108-
- name: Vet
109-
run: |
110-
make vet
111-
shell: bash
112-
113113
- name: Set up cache
114114
uses: actions/cache@v3
115115
env:
@@ -128,21 +128,20 @@ jobs:
128128
make install-tools
129129
shell: bash
130130

131-
- name: Lint
131+
- name: Test
132132
run: |
133-
make lint-pipeline
133+
make test
134134
shell: bash
135135

136-
reports:
137-
needs: linting
136+
linting:
138137
strategy:
139-
fail-fast: true
140-
max-parallel: 1
138+
fail-fast: false
139+
max-parallel: 2
141140
matrix:
142141
os: [ 'ubuntu-22.04' ]
143142
go: [ '1.19' ]
144143
runs-on: ${{ matrix.os }}
145-
name: Quality reports
144+
name: Run linters
146145
steps:
147146
- name: Checkout
148147
uses: actions/checkout@v3
@@ -157,6 +156,11 @@ jobs:
157156
go version
158157
shell: bash
159158
159+
- name: Vet
160+
run: |
161+
make vet
162+
shell: bash
163+
160164
- name: Set up cache
161165
uses: actions/cache@v3
162166
env:
@@ -172,46 +176,24 @@ jobs:
172176
173177
- name: Install tools
174178
run: |
175-
make install-tools
176-
shell: bash
177-
178-
- name: Prepare test coverage
179-
run: |
180-
make test-cover
181-
shell: bash
182-
183-
- name: Tests report
184-
run: |
185-
make test-sonar-report
179+
make install-tools
186180
shell: bash
187181

188-
- name: Prepare lint report
189-
run: |
190-
make lint-sonar
191-
shell: bash
192-
193-
- name: Cover report upload
194-
if: success()
182+
- name: Lint
195183
run: |
196-
bash <(curl -s https://codecov.io/bash) -f ./coverage/full.cov
184+
make lint-pipeline
197185
shell: bash
198186

199-
- name: SonarCloud report upload
200-
uses: sonarsource/sonarcloud-github-action@v1.8
201-
env:
202-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
203-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
204-
205-
build:
206-
needs: linting
187+
reports:
188+
needs: [testing, linting, build]
207189
strategy:
208-
fail-fast: false
209-
max-parallel: 2
190+
fail-fast: true
191+
max-parallel: 1
210192
matrix:
211193
os: [ 'ubuntu-22.04' ]
212194
go: [ '1.19' ]
213195
runs-on: ${{ matrix.os }}
214-
name: Build
196+
name: Quality reports
215197
steps:
216198
- name: Checkout
217199
uses: actions/checkout@v3
@@ -222,7 +204,6 @@ jobs:
222204
uses: actions/setup-go@v3.4.0
223205
with:
224206
go-version: ${{ matrix.go }}
225-
226207
- run: |
227208
go version
228209
shell: bash
@@ -245,12 +226,30 @@ jobs:
245226
make install-tools
246227
shell: bash
247228

248-
- name: Build
229+
- name: Prepare test coverage
249230
run: |
250-
make build
231+
make test-cover
251232
shell: bash
252233

253-
- name: Check release
234+
- name: Tests report
254235
run: |
255-
make check-releaser
236+
make test-sonar-report
256237
shell: bash
238+
239+
- name: Prepare lint report
240+
run: |
241+
make lint-sonar
242+
shell: bash
243+
244+
- name: Cover report upload
245+
if: success()
246+
run: |
247+
bash <(curl -s https://codecov.io/bash) -f ./coverage/full.cov
248+
shell: bash
249+
250+
- name: SonarCloud report upload
251+
uses: sonarsource/sonarcloud-github-action@v1.8
252+
env:
253+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
254+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
255+

.github/workflows/release.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
- name: Build
5454
run: |
5555
make build
56+
5657
regression_test:
5758
strategy:
5859
fail-fast: false
@@ -179,23 +180,10 @@ jobs:
179180
go version
180181
shell: bash
181182
182-
- name: Set up cache
183-
uses: actions/cache@v3
184-
env:
185-
cache-name: cache-vendored-tools-${{ secrets.CACHE_VERSION }}
183+
- name: Install GoReleaser
184+
uses: goreleaser/goreleaser-action@v3
186185
with:
187-
path: |
188-
${{ env.GOBIN }}
189-
~/.cache/go-build
190-
~/go/pkg/mod
191-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/tools/go.sum') }}
192-
restore-keys: |
193-
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/tools/go.sum') }}
194-
195-
- name: Install tools
196-
run: |
197-
make install-tools
198-
shell: bash
186+
install-only: true
199187

200188
- name: Run GoReleaser
201189
if: success()

0 commit comments

Comments
 (0)