Skip to content

Commit 9ff3778

Browse files
jkralikrodneyosodo
andauthored
chore: Fix CI (#620)
* chore: update go dependencies * chore: add dependabot * chore: update github workflows * style: ignore noctx for go 1.20 Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> * fix(ci): sonarcloud-github-action is deprecated * chore: For consistency bump actions/setup-go * chore: Skip mcast tests for any,all interfaces for macos --------- Signed-off-by: Rodney Osodo <socials@rodneyosodo.com> Co-authored-by: Rodney Osodo <socials@rodneyosodo.com>
1 parent f431046 commit 9ff3778

File tree

11 files changed

+111
-28
lines changed

11 files changed

+111
-28
lines changed

.github/dependabot.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "./.github/workflows"
5+
schedule:
6+
interval: "monthly"
7+
day: "monday"
8+
groups:
9+
gh-dependency:
10+
patterns:
11+
- "*"
12+
13+
- package-ecosystem: "gomod"
14+
directory: "/"
15+
schedule:
16+
interval: "monthly"
17+
day: "monday"
18+
groups:
19+
go-dependency:
20+
patterns:
21+
- "*"

.github/workflows/cifuzz.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
name: CIFuzz
2+
23
on:
34
pull_request:
45
workflow_dispatch:
6+
57
permissions: {}
8+
69
jobs:
710
Fuzzing:
811
runs-on: ubuntu-latest
12+
913
permissions:
1014
security-events: write
15+
1116
steps:
1217
- name: Build Fuzzers
1318
id: build
1419
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
1520
with:
1621
oss-fuzz-project-name: 'go-coap'
1722
language: go
23+
1824
- name: Run Fuzzers
1925
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
2026
with:
2127
oss-fuzz-project-name: 'go-coap'
2228
language: go
2329
fuzz-seconds: 300
2430
output-sarif: true
31+
2532
- name: Upload Crash
2633
uses: actions/upload-artifact@v4
2734
if: failure() && steps.build.outcome == 'success'
2835
with:
2936
name: artifacts
3037
path: ./out/artifacts
38+
3139
- name: Upload Sarif
3240
if: always() && steps.build.outcome == 'success'
3341
uses: github/codeql-action/upload-sarif@v3

.github/workflows/golangci-lint.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ name: Golangci-lint
88
on:
99
pull_request:
1010
workflow_dispatch:
11+
1112
jobs:
1213
golangci:
1314
name: lint
1415
runs-on: ubuntu-latest
16+
1517
steps:
1618
- name: Checkout
17-
uses: actions/checkout@v4
19+
uses: actions/checkout@v5
1820

1921
- name: Set up Go 1.20+
20-
uses: actions/setup-go@v5
22+
uses: actions/setup-go@v6
2123
with:
2224
go-version: "^1.20" # The Go version to download (if necessary) and use.
2325
check-latest: true
@@ -27,5 +29,5 @@ jobs:
2729
- name: golangci-lint
2830
uses: golangci/golangci-lint-action@v8
2931
with:
30-
version: latest
32+
version: v2.4.0
3133
args: --timeout=5m

.github/workflows/staticAnalysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111

1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1515

1616
- name: Set up Go 1.20+
17-
uses: actions/setup-go@v5
17+
uses: actions/setup-go@v6
1818
with:
1919
go-version: "^1.20" # The Go version to download (if necessary) and use.
2020
check-latest: true

.github/workflows/test-for-fork.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- name: Set up Go 1.20+
18-
uses: actions/setup-go@v5
18+
uses: actions/setup-go@v6
1919
with:
2020
go-version: "^1.20"
2121
check-latest: true
@@ -24,7 +24,7 @@ jobs:
2424

2525
# Checks-out repository under $GITHUB_WORKSPACE
2626
- name: Checkout
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
2828

2929
# Build everything
3030
- name: Run a build

.github/workflows/test.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
steps:
2626
- name: Set up Go 1.20+
27-
uses: actions/setup-go@v5
27+
uses: actions/setup-go@v6
2828
with:
2929
go-version: "^1.20"
3030
check-latest: true
@@ -33,7 +33,7 @@ jobs:
3333

3434
# Checks-out repository under $GITHUB_WORKSPACE with tags and history (needed by "SonarCloud Scan" step)
3535
- name: Full checkout
36-
uses: actions/checkout@v4
36+
uses: actions/checkout@v5
3737
with:
3838
fetch-depth: 0 # Full clone for SonarCloud
3939

@@ -73,12 +73,12 @@ jobs:
7373
runs-on: ubuntu-latest
7474
steps:
7575
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
76-
- uses: actions/checkout@v4
76+
- uses: actions/checkout@v5
7777
with:
7878
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
7979

8080
- name: Download artifacts
81-
uses: actions/download-artifact@v4
81+
uses: actions/download-artifact@v5
8282
with:
8383
path: ./outputs
8484

@@ -90,13 +90,13 @@ jobs:
9090
find ./outputs -name "*.report.json" -exec sh -c 'cp $1 .tmp/report/$(echo $1 | sed "s/[\/.]/-/g" ).report.json' _ {} \;
9191
9292
- name: Code coverage
93-
uses: codecov/codecov-action@v4.0.0-beta.3
93+
uses: codecov/codecov-action@v5
9494
with:
9595
token: ${{ secrets.CODECOV_TOKEN }}
9696
directory: .tmp/
9797

98-
- name: SonarCloud Scan
99-
uses: SonarSource/sonarcloud-github-action@master
98+
- name: SonarQube Scan
99+
uses: SonarSource/sonarqube-scan-action@v5
100100
env:
101101
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102102
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
@@ -112,14 +112,14 @@ jobs:
112112

113113
steps:
114114
- name: Set up Go 1.20
115-
uses: actions/setup-go@v5
115+
uses: actions/setup-go@v6
116116
with:
117117
go-version: "~1.20"
118118

119119
- run: go version
120120

121121
- name: Checkout
122-
uses: actions/checkout@v4
122+
uses: actions/checkout@v5
123123

124124
- name: Run a build
125125
run: go build ./...

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ linters:
4646
- nestif # Reports deeply nested if statements
4747
- nilerr # Finds the code that returns nil even if it checks that the error is not nil.
4848
- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value.
49-
- noctx # noctx finds sending http request without context.Context
49+
# - noctx # noctx finds sending http request without context.Context - Some occurrences are not support in go1.20
5050
- nolintlint # Reports ill-formed or insufficient nolint directives
5151
- nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL
5252
- perfsprint # Checks that fmt.Sprintf can be replaced with a faster alternative.

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ go 1.20
44

55
require (
66
github.com/dsnet/golib/memfile v1.0.0
7-
github.com/pion/dtls/v3 v3.0.6
8-
github.com/stretchr/testify v1.9.0
7+
github.com/pion/dtls/v3 v3.0.7
8+
github.com/stretchr/testify v1.11.1
99
go.uber.org/atomic v1.11.0
1010
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e
1111
golang.org/x/net v0.35.0
@@ -14,7 +14,7 @@ require (
1414

1515
require (
1616
github.com/davecgh/go-spew v1.1.1 // indirect
17-
github.com/pion/logging v0.2.3 // indirect
17+
github.com/pion/logging v0.2.4 // indirect
1818
github.com/pion/transport/v3 v3.0.7 // indirect
1919
github.com/pmezard/go-difflib v1.0.0 // indirect
2020
golang.org/x/crypto v0.33.0 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
22
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
33
github.com/dsnet/golib/memfile v1.0.0 h1:J9pUspY2bDCbF9o+YGwcf3uG6MdyITfh/Fk3/CaEiFs=
44
github.com/dsnet/golib/memfile v1.0.0/go.mod h1:tXGNW9q3RwvWt1VV2qrRKlSSz0npnh12yftCSCy2T64=
5-
github.com/pion/dtls/v3 v3.0.6 h1:7Hkd8WhAJNbRgq9RgdNh1aaWlZlGpYTzdqjy9x9sK2E=
6-
github.com/pion/dtls/v3 v3.0.6/go.mod h1:iJxNQ3Uhn1NZWOMWlLxEEHAN5yX7GyPvvKw04v9bzYU=
7-
github.com/pion/logging v0.2.3 h1:gHuf0zpoh1GW67Nr6Gj4cv5Z9ZscU7g/EaoC/Ke/igI=
8-
github.com/pion/logging v0.2.3/go.mod h1:z8YfknkquMe1csOrxK5kc+5/ZPAzMxbKLX5aXpbpC90=
5+
github.com/pion/dtls/v3 v3.0.7 h1:bItXtTYYhZwkPFk4t1n3Kkf5TDrfj6+4wG+CZR8uI9Q=
6+
github.com/pion/dtls/v3 v3.0.7/go.mod h1:uDlH5VPrgOQIw59irKYkMudSFprY9IEFCqz/eTz16f8=
7+
github.com/pion/logging v0.2.4 h1:tTew+7cmQ+Mc1pTBLKH2puKsOvhm32dROumOZ655zB8=
8+
github.com/pion/logging v0.2.4/go.mod h1:DffhXTKYdNZU+KtJ5pyQDjvOAh/GsNSyv1lbkFbe3so=
99
github.com/pion/transport/v3 v3.0.7 h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0=
1010
github.com/pion/transport/v3 v3.0.7/go.mod h1:YleKiTZ4vqNxVwh77Z0zytYi7rXHl7j6uPLGhhz9rwo=
1111
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1212
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
13-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
14-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
13+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
14+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
1515
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
1616
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
1717
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=

net/connUDP_internal_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ func TestUDPConnwriteMulticastWithContext(t *testing.T) {
140140
}
141141
}
142142
require.NotEmpty(t, iface)
143+
const goosDarwin = "darwin"
143144

144145
type args struct {
145146
ctx context.Context
@@ -151,6 +152,7 @@ func TestUDPConnwriteMulticastWithContext(t *testing.T) {
151152
name string
152153
args args
153154
wantErr bool
155+
skip func() bool
154156
}{
155157
{
156158
name: "valid all interfaces",
@@ -160,6 +162,9 @@ func TestUDPConnwriteMulticastWithContext(t *testing.T) {
160162
buffer: payload,
161163
opts: []MulticastOption{WithAllMulticastInterface()},
162164
},
165+
skip: func() bool {
166+
return runtime.GOOS == goosDarwin
167+
},
163168
},
164169
{
165170
name: "valid any interface",
@@ -169,6 +174,9 @@ func TestUDPConnwriteMulticastWithContext(t *testing.T) {
169174
buffer: payload,
170175
opts: []MulticastOption{WithAnyMulticastInterface()},
171176
},
177+
skip: func() bool {
178+
return runtime.GOOS == goosDarwin
179+
},
172180
},
173181
{
174182
name: "valid first interface",
@@ -242,6 +250,10 @@ func TestUDPConnwriteMulticastWithContext(t *testing.T) {
242250

243251
for _, tt := range tests {
244252
t.Run(tt.name, func(t *testing.T) {
253+
if tt.skip != nil && tt.skip() {
254+
t.Log("skipped")
255+
return
256+
}
245257
err = c1.WriteMulticast(tt.args.ctx, tt.args.udpAddr, tt.args.buffer, tt.args.opts...)
246258
c1.LocalAddr()
247259
c1.RemoteAddr()
@@ -361,6 +373,7 @@ func TestUDPConnWriteToAddr(t *testing.T) {
361373
name string
362374
args args
363375
wantErr bool
376+
skip func() bool
364377
}{
365378
{
366379
name: "IPv4",
@@ -407,6 +420,9 @@ func TestUDPConnWriteToAddr(t *testing.T) {
407420
raddr: &net.UDPAddr{IP: net.IPv4(224, 0, 0, 1), Port: 1234},
408421
buffer: []byte("hello world"),
409422
},
423+
skip: func() bool {
424+
return runtime.GOOS == "darwin"
425+
},
410426
},
411427
{
412428
name: "with interface and source",
@@ -421,6 +437,10 @@ func TestUDPConnWriteToAddr(t *testing.T) {
421437

422438
for _, tt := range tests {
423439
t.Run(tt.name, func(t *testing.T) {
440+
if tt.skip != nil && tt.skip() {
441+
t.Log("skipped")
442+
return
443+
}
424444
network := udp4Network
425445
ip := getIfaceAddr(t, iface, true)
426446
if IsIPv6(tt.args.src) {

0 commit comments

Comments
 (0)