Skip to content

Commit 840c7c5

Browse files
authored
Update deps (#27)
1 parent 0082811 commit 840c7c5

File tree

9 files changed

+79
-128
lines changed

9 files changed

+79
-128
lines changed

.github/workflows/bench.yml

Lines changed: 33 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,27 @@ on:
1212
description: 'New Ref'
1313
required: true
1414

15-
# Cancel the workflow in progress in newer build is about to start.
16-
concurrency:
17-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18-
cancel-in-progress: true
19-
2015
env:
2116
GO111MODULE: "on"
2217
CACHE_BENCHMARK: "off" # Enables benchmark result reuse between runs, may skew latency results.
2318
RUN_BASE_BENCHMARK: "on" # Runs benchmark for PR base in case benchmark result is missing.
24-
GO_VERSION: 1.20.x
2519
jobs:
2620
bench:
21+
strategy:
22+
matrix:
23+
go-version: [ stable ]
2724
runs-on: ubuntu-latest
2825
steps:
29-
- name: Install Go stable
30-
if: env.GO_VERSION != 'tip'
31-
uses: actions/setup-go@v4
26+
- name: Install Go
27+
uses: actions/setup-go@v5
3228
with:
33-
go-version: ${{ env.GO_VERSION }}
34-
35-
- name: Install Go tip
36-
if: env.GO_VERSION == 'tip'
37-
run: |
38-
curl -sL https://storage.googleapis.com/go-build-snap/go/linux-amd64/$(git ls-remote https://github.com/golang/go.git HEAD | awk '{print $1;}').tar.gz -o gotip.tar.gz
39-
ls -lah gotip.tar.gz
40-
mkdir -p ~/sdk/gotip
41-
tar -C ~/sdk/gotip -xzf gotip.tar.gz
42-
~/sdk/gotip/bin/go version
43-
echo "PATH=$HOME/go/bin:$HOME/sdk/gotip/bin/:$PATH" >> $GITHUB_ENV
44-
29+
go-version: ${{ matrix.go-version }}
4530
- name: Checkout code
46-
uses: actions/checkout@v3
31+
uses: actions/checkout@v4
4732
with:
4833
ref: ${{ (github.event.inputs.new != '') && github.event.inputs.new || github.event.ref }}
49-
5034
- name: Go cache
51-
uses: actions/cache@v3
35+
uses: actions/cache@v4
5236
with:
5337
# In order:
5438
# * Module download cache
@@ -59,58 +43,49 @@ jobs:
5943
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
6044
restore-keys: |
6145
${{ runner.os }}-go-cache
62-
6346
- name: Restore benchstat
64-
uses: actions/cache@v3
47+
uses: actions/cache@v4
6548
with:
6649
path: ~/go/bin/benchstat
67-
key: ${{ runner.os }}-benchstat-legacy
68-
50+
key: ${{ runner.os }}-benchstat
6951
- name: Restore base benchmark result
70-
id: base-benchmark
7152
if: env.CACHE_BENCHMARK == 'on'
72-
uses: actions/cache@v3
53+
id: benchmark-base
54+
uses: actions/cache@v4
7355
with:
7456
path: |
7557
bench-master.txt
7658
bench-main.txt
7759
# Use base sha for PR or new commit hash for master/main push in benchmark result key.
7860
key: ${{ runner.os }}-bench-${{ (github.event.pull_request.base.sha != github.event.after) && github.event.pull_request.base.sha || github.event.after }}
79-
80-
- name: Run benchmark
81-
run: |
82-
export REF_NAME=new
83-
make bench
84-
OUTPUT=$(make bench-stat-diff)
85-
echo "${OUTPUT}"
86-
echo "diff<<EOF" >> $GITHUB_OUTPUT && echo "$OUTPUT" >> $GITHUB_OUTPUT && echo "EOF" >> $GITHUB_OUTPUT
87-
OUTPUT=$(make bench-stat)
88-
echo "${OUTPUT}"
89-
echo "result<<EOF" >> $GITHUB_OUTPUT && echo "$OUTPUT" >> $GITHUB_OUTPUT && echo "EOF" >> $GITHUB_OUTPUT
90-
91-
- name: Run benchmark for base code
92-
if: env.RUN_BASE_BENCHMARK == 'on' && steps.base-benchmark.outputs.cache-hit != 'true' && (github.event.pull_request.base.sha != '' || github.event.inputs.old != '')
61+
- name: Checkout base code
62+
if: env.RUN_BASE_BENCHMARK == 'on' && steps.benchmark-base.outputs.cache-hit != 'true' && (github.event.pull_request.base.sha != '' || github.event.inputs.old != '')
63+
uses: actions/checkout@v4
64+
with:
65+
ref: ${{ (github.event.pull_request.base.sha != '' ) && github.event.pull_request.base.sha || github.event.inputs.old }}
66+
path: __base
67+
- name: Run base benchmark
68+
if: env.RUN_BASE_BENCHMARK == 'on' && steps.benchmark-base.outputs.cache-hit != 'true' && (github.event.pull_request.base.sha != '' || github.event.inputs.old != '')
9369
run: |
94-
git fetch origin master ${{ github.event.pull_request.base.sha }}
95-
HEAD=$(git rev-parse HEAD)
96-
git reset --hard ${{ github.event.pull_request.base.sha }}
9770
export REF_NAME=master
98-
make bench-run bench-stat
99-
git reset --hard $HEAD
100-
101-
- name: Benchmark stats
71+
cd __base
72+
make | grep bench-run && (BENCH_COUNT=5 make bench-run bench-stat && cp bench-master.txt ../bench-master.txt) || echo "No benchmarks in base"
73+
- name: Benchmark
10274
id: bench
10375
run: |
10476
export REF_NAME=new
77+
BENCH_COUNT=5 make bench
10578
OUTPUT=$(make bench-stat-diff)
106-
echo "${OUTPUT}"
107-
echo "diff<<EOF" >> $GITHUB_OUTPUT && echo "$OUTPUT" >> $GITHUB_OUTPUT && echo "EOF" >> $GITHUB_OUTPUT
79+
OUTPUT="${OUTPUT//'%'/'%25'}"
80+
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
81+
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
82+
echo "::set-output name=diff::$OUTPUT"
10883
OUTPUT=$(make bench-stat)
109-
echo "${OUTPUT}"
110-
echo "result<<EOF" >> $GITHUB_OUTPUT && echo "$OUTPUT" >> $GITHUB_OUTPUT && echo "EOF" >> $GITHUB_OUTPUT
111-
112-
- name: Comment benchmark result
113-
continue-on-error: true
84+
OUTPUT="${OUTPUT//'%'/'%25'}"
85+
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
86+
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
87+
echo "::set-output name=result::$OUTPUT"
88+
- name: Comment Benchmark Result
11489
uses: marocchino/sticky-pull-request-comment@v2
11590
with:
11691
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/cloc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
with:
1818
path: pr
1919
- name: Checkout base code
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121
with:
2222
ref: ${{ github.event.pull_request.base.sha }}
2323
path: base

.github/workflows/golangci-lint.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ jobs:
1919
name: golangci-lint
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/setup-go@v3
22+
- uses: actions/setup-go@v5
2323
with:
24-
go-version: 1.20.x
25-
- uses: actions/checkout@v2
24+
go-version: stable
25+
- uses: actions/checkout@v4
2626
- name: golangci-lint
27-
uses: golangci/golangci-lint-action@v3.4.0
27+
uses: golangci/golangci-lint-action@v6.5.0
2828
with:
2929
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
30-
version: v1.51.1
30+
version: v1.64.5
3131

3232
# Optional: working directory, useful for monorepos
3333
# working-directory: somedir

.github/workflows/gorelease.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,19 @@ concurrency:
99
cancel-in-progress: true
1010

1111
env:
12-
GO_VERSION: 1.20.x
12+
GO_VERSION: stable
1313
jobs:
1414
gorelease:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- name: Install Go stable
18-
if: env.GO_VERSION != 'tip'
19-
uses: actions/setup-go@v4
17+
- name: Install Go
18+
uses: actions/setup-go@v5
2019
with:
2120
go-version: ${{ env.GO_VERSION }}
22-
- name: Install Go tip
23-
if: env.GO_VERSION == 'tip'
24-
run: |
25-
curl -sL https://storage.googleapis.com/go-build-snap/go/linux-amd64/$(git ls-remote https://github.com/golang/go.git HEAD | awk '{print $1;}').tar.gz -o gotip.tar.gz
26-
ls -lah gotip.tar.gz
27-
mkdir -p ~/sdk/gotip
28-
tar -C ~/sdk/gotip -xzf gotip.tar.gz
29-
~/sdk/gotip/bin/go version
30-
echo "PATH=$HOME/go/bin:$HOME/sdk/gotip/bin/:$PATH" >> $GITHUB_ENV
3121
- name: Checkout code
32-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
3323
- name: Gorelease cache
34-
uses: actions/cache@v3
24+
uses: actions/cache@v4
3525
with:
3626
path: |
3727
~/go/bin/gorelease

.github/workflows/test-unit.yml

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,25 @@ concurrency:
1515
env:
1616
GO111MODULE: "on"
1717
RUN_BASE_COVERAGE: "on" # Runs test for PR base in case base test coverage is missing.
18-
COV_GO_VERSION: 1.20.x # Version of Go to collect coverage
18+
COV_GO_VERSION: stable # Version of Go to collect coverage
1919
TARGET_DELTA_COV: 90 # Target coverage of changed lines, in percents
2020
jobs:
2121
test:
2222
strategy:
2323
matrix:
24-
go-version: [ 1.16.x, 1.19.x, 1.20.x ]
24+
go-version: [ stable, oldstable ]
2525
runs-on: ubuntu-latest
2626
steps:
27-
- name: Install Go stable
28-
if: matrix.go-version != 'tip'
29-
uses: actions/setup-go@v4
27+
- name: Install Go
28+
uses: actions/setup-go@v5
3029
with:
3130
go-version: ${{ matrix.go-version }}
3231

33-
- name: Install Go tip
34-
if: matrix.go-version == 'tip'
35-
run: |
36-
curl -sL https://storage.googleapis.com/go-build-snap/go/linux-amd64/$(git ls-remote https://github.com/golang/go.git HEAD | awk '{print $1;}').tar.gz -o gotip.tar.gz
37-
ls -lah gotip.tar.gz
38-
mkdir -p ~/sdk/gotip
39-
tar -C ~/sdk/gotip -xzf gotip.tar.gz
40-
~/sdk/gotip/bin/go version
41-
echo "PATH=$HOME/go/bin:$HOME/sdk/gotip/bin/:$PATH" >> $GITHUB_ENV
42-
4332
- name: Checkout code
44-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
4534

4635
- name: Go cache
47-
uses: actions/cache@v3
36+
uses: actions/cache@v4
4837
with:
4938
# In order:
5039
# * Module download cache
@@ -59,7 +48,7 @@ jobs:
5948
- name: Restore base test coverage
6049
id: base-coverage
6150
if: matrix.go-version == env.COV_GO_VERSION && github.event.pull_request.base.sha != ''
62-
uses: actions/cache@v2
51+
uses: actions/cache@v4
6352
with:
6453
path: |
6554
unit-base.txt
@@ -88,14 +77,14 @@ jobs:
8877
id: annotate
8978
if: matrix.go-version == env.COV_GO_VERSION && github.event.pull_request.base.sha != ''
9079
run: |
91-
curl -sLO https://github.com/vearutop/gocovdiff/releases/download/v1.3.6/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz
80+
curl -sLO https://github.com/vearutop/gocovdiff/releases/download/v1.4.2/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz && rm linux_amd64.tar.gz
9281
gocovdiff_hash=$(git hash-object ./gocovdiff)
93-
[ "$gocovdiff_hash" == "8e507e0d671d4d6dfb3612309b72b163492f28eb" ] || (echo "::error::unexpected hash for gocovdiff, possible tampering: $gocovdiff_hash" && exit 1)
82+
[ "$gocovdiff_hash" == "c37862c73a677e5a9c069470287823ab5bbf0244" ] || (echo "::error::unexpected hash for gocovdiff, possible tampering: $gocovdiff_hash" && exit 1)
9483
git fetch origin master ${{ github.event.pull_request.base.sha }}
95-
REP=$(./gocovdiff -cov unit.coverprofile -gha-annotations gha-unit.txt -delta-cov-file delta-cov-unit.txt -target-delta-cov ${TARGET_DELTA_COV})
84+
REP=$(./gocovdiff -mod github.com/$GITHUB_REPOSITORY -cov unit.coverprofile -gha-annotations gha-unit.txt -delta-cov-file delta-cov-unit.txt -target-delta-cov ${TARGET_DELTA_COV})
9685
echo "${REP}"
9786
cat gha-unit.txt
98-
DIFF=$(test -e unit-base.txt && ./gocovdiff -func-cov unit.txt -func-base-cov unit-base.txt || echo "Missing base coverage file")
87+
DIFF=$(test -e unit-base.txt && ./gocovdiff -mod github.com/$GITHUB_REPOSITORY -func-cov unit.txt -func-base-cov unit-base.txt || echo "Missing base coverage file")
9988
TOTAL=$(cat delta-cov-unit.txt)
10089
echo "rep<<EOF" >> $GITHUB_OUTPUT && echo "$REP" >> $GITHUB_OUTPUT && echo "EOF" >> $GITHUB_OUTPUT
10190
echo "diff<<EOF" >> $GITHUB_OUTPUT && echo "$DIFF" >> $GITHUB_OUTPUT && echo "EOF" >> $GITHUB_OUTPUT
@@ -130,7 +119,7 @@ jobs:
130119

131120
- name: Upload code coverage
132121
if: matrix.go-version == env.COV_GO_VERSION
133-
uses: codecov/codecov-action@v1
122+
uses: codecov/codecov-action@v5
134123
with:
135-
file: ./unit.coverprofile
124+
files: ./unit.coverprofile
136125
flags: unittests

.golangci.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ linters-settings:
1212
threshold: 100
1313
misspell:
1414
locale: US
15-
unused:
16-
check-exported: false
1715
unparam:
1816
check-exported: true
1917
cyclop:
@@ -24,50 +22,47 @@ linters-settings:
2422
linters:
2523
enable-all: true
2624
disable:
25+
- intrange
26+
- copyloopvar
2727
- lll
28-
- maligned
2928
- gochecknoglobals
30-
- gomnd
3129
- wrapcheck
3230
- paralleltest
3331
- forbidigo
34-
- exhaustivestruct
35-
- interfacer # deprecated
3632
- forcetypeassert
37-
- scopelint # deprecated
38-
- ifshort # too many false positives
39-
- golint # deprecated
4033
- varnamelen
4134
- tagliatelle
4235
- errname
4336
- ireturn
4437
- exhaustruct
4538
- nonamedreturns
46-
- nosnakecase
47-
- structcheck
48-
- varcheck
49-
- deadcode
5039
- testableexamples
5140
- dupword
41+
- depguard
42+
- tagalign
43+
- mnd
44+
- testifylint
45+
- recvcheck
5246

5347
issues:
5448
exclude-use-default: false
5549
exclude-rules:
5650
- linters:
5751
- gosec
58-
- gomnd
52+
- errcheck
53+
- mnd
5954
- goconst
60-
- goerr113
6155
- noctx
6256
- funlen
6357
- dupl
64-
- structcheck
6558
- unused
6659
- unparam
67-
- nosnakecase
6860
path: "_test.go"
6961
- linters:
7062
- errcheck # Error checking omitted for brevity.
7163
- gosec
7264
path: "example_"
65+
- linters:
66+
- revive
67+
text: "unused-parameter: parameter"
7368

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#GOLANGCI_LINT_VERSION := "v1.51.1" # Optional configuration to pinpoint golangci-lint version.
1+
#GOLANGCI_LINT_VERSION := "v1.64.5" # Optional configuration to pinpoint golangci-lint version.
22

33
# The head of Makefile determines location of dev-go to include standard targets.
44
GO ?= go

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module github.com/vearutop/statigz
33
go 1.17
44

55
require (
6-
github.com/andybalholm/brotli v1.0.5
7-
github.com/bool64/dev v0.2.28
6+
github.com/andybalholm/brotli v1.1.1
7+
github.com/bool64/dev v0.2.39
88
github.com/stretchr/testify v1.4.0
99
)
1010

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
2-
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
3-
github.com/bool64/dev v0.2.28 h1:6ayDfrB/jnNr2iQAZHI+uT3Qi6rErSbJYQs1y8rSrwM=
4-
github.com/bool64/dev v0.2.28/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
1+
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
2+
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
3+
github.com/bool64/dev v0.2.39 h1:kP8DnMGlWXhGYJEZE/J0l/gVBdbuhoPGL+MJG4QbofE=
4+
github.com/bool64/dev v0.2.39/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
55
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
66
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
77
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
88
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
99
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
1010
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
1111
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
12+
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
13+
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
1214
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1315
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1416
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

0 commit comments

Comments
 (0)