Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI #103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ updates:
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
33 changes: 16 additions & 17 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ name: Static Analysis

on:
push:
branches:
- "*"
paths:
- "go.sum"
- "go.mod"
- "**.go"
- ".github/workflows/static-analysis.yml"
- ".golangci.yml"
pull_request:
branches:
- "*"

permissions:
contents: read

jobs:
build:
Expand All @@ -19,22 +24,16 @@ jobs:

steps:
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/[email protected]

- name: Print staticcheck version
run: staticcheck -version
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Run staticcheck
run: staticcheck ./...

- name: Run go vet
run: go vet ./...
- name: Lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
args: --verbose
version: v1.63.4
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:

steps:
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Run basic tests, we just want to make sure there is parity on Linux and
# macOS, and back to the oldest version of Go this library supports.
Expand Down
8 changes: 8 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
output:
sort-results: true

linters:
# Keep this list sorted alphabetically
enable:
- revive
12 changes: 6 additions & 6 deletions client_linux_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ func TestIntegrationLinuxConcurrent(t *testing.T) {
}
}

func execN(t *testing.T, n int, expect []string, worker_id int) {
func execN(t *testing.T, n int, expect []string, workerID int) {
c := testClient(t)

names := make(map[string]int)
for i := 0; i < n; i++ {
ifis, err := c.Interfaces()
if err != nil {
panicf("[worker_id %d; iteration %d] failed to retrieve interfaces: %v", worker_id, i, err)
panicf("[worker_id %d; iteration %d] failed to retrieve interfaces: %v", workerID, i, err)
}

for _, ifi := range ifis {
Expand All @@ -69,13 +69,13 @@ func execN(t *testing.T, n int, expect []string, worker_id int) {

if _, err := c.StationInfo(ifi); err != nil {
if !errors.Is(err, os.ErrNotExist) {
panicf("[worker_id %d; iteration %d] failed to retrieve station info for device %s: %v", worker_id, i, ifi.Name, err)
panicf("[worker_id %d; iteration %d] failed to retrieve station info for device %s: %v", workerID, i, ifi.Name, err)
}
}

if _, err := c.SurveyInfo(ifi); err != nil {
if !errors.Is(err, os.ErrNotExist) {
panicf("[worker_id %d; iteration %d] failed to retrieve survey info for device %s: %v", worker_id, i, ifi.Name, err)
panicf("[worker_id %d; iteration %d] failed to retrieve survey info for device %s: %v", workerID, i, ifi.Name, err)
}
}
names[ifi.Name]++
Expand All @@ -85,10 +85,10 @@ func execN(t *testing.T, n int, expect []string, worker_id int) {
for _, e := range expect {
nn, ok := names[e]
if !ok {
panicf("[worker_id %d] did not find interface %q during test", worker_id, e)
panicf("[worker_id %d] did not find interface %q during test", workerID, e)
}
if nn != n {
panicf("[worker_id %d] wanted to find %q %d times, found %d", worker_id, e, n, nn)
panicf("[worker_id %d] wanted to find %q %d times, found %d", workerID, e, n, nn)
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions wifi.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ func (l BSSLoad) String() string {
return fmt.Sprintf("BSSLoad Version: %d stationCount: %d channelUtilization: %d/255 availableAdmissionCapacity: %d [*32us/s]\n",
l.Version, l.StationCount, l.ChannelUtilization, l.AvailableAdmissionCapacity,
)
} else {
return fmt.Sprintf("invalid BSSLoad Version: %d", l.Version)
}
return fmt.Sprintf("invalid BSSLoad Version: %d", l.Version)
}

// A BSS is an 802.11 basic service set. It contains information about a wireless
Expand Down
Loading