diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a98585..b6b8da8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: # benchmarks. At the end do a quick check to ensure the tests to not leave # files in the tree. test: - name: "test: go${{matrix.gover}}.x/${{matrix.os}}" + name: "test: ${{matrix.os}}" runs-on: "${{matrix.os}}" continue-on-error: true defaults: @@ -29,8 +29,6 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - # Do not forget to bump every 6 months! - gover: ["1.19"] env: PYTHONDONTWRITEBYTECODE: x steps: @@ -40,10 +38,9 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 2 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: - go-version: "~${{matrix.gover}}.0" - cache: true + go-version-file: go.mod - name: 'go install necessary tools' if: always() run: | @@ -53,6 +50,7 @@ jobs: run: go test -timeout=120s -covermode=count -coverprofile coverage.txt -bench=. -benchtime=1x ./... # Don't send code coverage if anything failed to reduce spam. - uses: codecov/codecov-action@v2 + timeout-minutes: 1 - name: 'Cleanup' if: always() run: rm coverage.txt @@ -87,7 +85,7 @@ jobs: # to cut on runtime, at the cost of latency. I dislike waiting for results # so I prefer to run them in parallel. lint: - name: "lint: go${{matrix.gover}}.x/${{matrix.os}}" + name: "lint: ${{matrix.os}}" runs-on: "${{matrix.os}}" continue-on-error: true defaults: @@ -100,8 +98,6 @@ jobs: # OS-specific code benefits from explicitly linting on macOS and # Windows. os: [ubuntu-latest, macos-latest, windows-latest] - # Do not forget to bump every 6 months! - gover: ["1.19"] env: PYTHONDONTWRITEBYTECODE: x steps: @@ -109,10 +105,9 @@ jobs: if: matrix.os == 'windows-latest' run: git config --global core.autocrlf false - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: - go-version: "~${{matrix.gover}}.0" - cache: true + go-version-file: go.mod - name: "Debug" run: | echo HOME = $HOME @@ -296,23 +291,20 @@ jobs: codeql: - name: "codeql: go${{matrix.gover}}.x/${{matrix.os}}" + name: "codeql: ${{matrix.os}}" runs-on: "${{matrix.os}}" continue-on-error: true strategy: fail-fast: false matrix: os: [ubuntu-latest] - # Do not forget to bump every 6 months! - gover: ["1.19"] permissions: security-events: write steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: - go-version: "~${{matrix.gover}}.0" - cache: true + go-version-file: go.mod - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: diff --git a/analog/analog_test.go b/analog/analog_test.go index 6f080b9..0444e2d 100644 --- a/analog/analog_test.go +++ b/analog/analog_test.go @@ -35,7 +35,10 @@ func TestINVALID(t *testing.T) { if INVALID.Halt() == nil { t.Fatal("Halt") } - INVALID.Range() + sample := Sample{} + if s1, s2 := INVALID.Range(); s1 != sample || s2 != sample { + t.Fatal("Range") + } if _, err := INVALID.Read(); err == nil { t.Fatal("Read") } diff --git a/go.mod b/go.mod index 392bfe9..12bcb9a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ module periph.io/x/conn/v3 -go 1.17 +go 1.20 // Warning: do not add any external dependencies here unless absolutely necessary. // This package should primarily depend on the standard library.