Skip to content

Commit a12de32

Browse files
authored
sync: update CI config files (#85)
1 parent 1edf30e commit a12de32

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

.github/workflows/go-check.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
env:
1212
RUNGOGENERATE: false
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515
with:
1616
submodules: recursive
17-
- uses: actions/setup-go@v2
17+
- uses: actions/setup-go@v3
1818
with:
19-
go-version: "1.18.x"
19+
go-version: "1.19.x"
2020
- name: Run repo-specific setup
2121
uses: ./.github/actions/go-check-setup
2222
if: hashFiles('./.github/actions/go-check-setup') != ''
@@ -27,7 +27,7 @@ jobs:
2727
echo "RUNGOGENERATE=true" >> $GITHUB_ENV
2828
fi
2929
- name: Install staticcheck
30-
run: go install honnef.co/go/tools/cmd/staticcheck@d7e217c1ff411395475b2971c0824e1e7cc1af98 # 2022.1 (v0.3.0)
30+
run: go install honnef.co/go/tools/cmd/staticcheck@376210a89477dedbe6fdc4484b233998650d7b3c # 2022.1.3 (v0.3.3)
3131
- name: Check that go.mod is tidy
3232
uses: protocol/[email protected]
3333
with:

.github/workflows/go-test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
os: [ "ubuntu", "windows", "macos" ]
13-
go: [ "1.17.x", "1.18.x" ]
13+
go: [ "1.18.x", "1.19.x" ]
1414
env:
1515
COVERAGES: ""
1616
runs-on: ${{ format('{0}-latest', matrix.os) }}
1717
name: ${{ matrix.os }} (go ${{ matrix.go }})
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
2020
with:
2121
submodules: recursive
22-
- uses: actions/setup-go@v2
22+
- uses: actions/setup-go@v3
2323
with:
2424
go-version: ${{ matrix.go }}
2525
- name: Go information
@@ -43,7 +43,7 @@ jobs:
4343
# Use -coverpkg=./..., so that we include cross-package coverage.
4444
# If package ./A imports ./B, and ./A's tests also cover ./B,
4545
# this means ./B's coverage will be significantly higher than 0%.
46-
run: go test -v -coverprofile=module-coverage.txt -coverpkg=./... ./...
46+
run: go test -v -shuffle=on -coverprofile=module-coverage.txt -coverpkg=./... ./...
4747
- name: Run tests (32 bit)
4848
if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX.
4949
uses: protocol/[email protected]
@@ -52,7 +52,7 @@ jobs:
5252
with:
5353
run: |
5454
export "PATH=${{ env.PATH_386 }}:$PATH"
55-
go test -v ./...
55+
go test -v -shuffle=on ./...
5656
- name: Run tests with race detector
5757
if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow
5858
uses: protocol/[email protected]
@@ -62,7 +62,7 @@ jobs:
6262
shell: bash
6363
run: echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
6464
- name: Upload coverage to Codecov
65-
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
65+
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
6666
with:
6767
files: '${{ env.COVERAGES }}'
6868
env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ require (
2424
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
2525
)
2626

27-
go 1.17
27+
go 1.18

node_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"encoding/hex"
66
"encoding/json"
77
"fmt"
8-
"io/ioutil"
98
"math"
109
"math/big"
10+
"os"
1111
"sort"
1212
"strings"
1313
"testing"
@@ -408,7 +408,7 @@ func TestExamples(t *testing.T) {
408408
}
409409

410410
func TestObjects(t *testing.T) {
411-
raw, err := ioutil.ReadFile("test_objects/expected.json")
411+
raw, err := os.ReadFile("test_objects/expected.json")
412412
if err != nil {
413413
t.Fatal(err)
414414
}
@@ -421,11 +421,11 @@ func TestObjects(t *testing.T) {
421421

422422
for k, c := range cases {
423423
t.Run(k, func(t *testing.T) {
424-
in, err := ioutil.ReadFile(fmt.Sprintf("test_objects/%s.json", k))
424+
in, err := os.ReadFile(fmt.Sprintf("test_objects/%s.json", k))
425425
if err != nil {
426426
t.Fatal(err)
427427
}
428-
expected, err := ioutil.ReadFile(fmt.Sprintf("test_objects/%s.cbor", k))
428+
expected, err := os.ReadFile(fmt.Sprintf("test_objects/%s.cbor", k))
429429
if err != nil {
430430
t.Fatal(err)
431431
}
@@ -452,7 +452,7 @@ func TestObjects(t *testing.T) {
452452
}
453453

454454
func TestCanonicalize(t *testing.T) {
455-
b, err := ioutil.ReadFile("test_objects/non-canon.cbor")
455+
b, err := os.ReadFile("test_objects/non-canon.cbor")
456456
if err != nil {
457457
t.Fatal(err)
458458
}
@@ -479,7 +479,7 @@ func TestCanonicalize(t *testing.T) {
479479
}
480480

481481
func TestStableCID(t *testing.T) {
482-
b, err := ioutil.ReadFile("test_objects/non-canon.cbor")
482+
b, err := os.ReadFile("test_objects/non-canon.cbor")
483483
if err != nil {
484484
t.Fatal(err)
485485
}

readable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/polydawn/refmt/shared"
1010
)
1111

12-
//HumanReadable returns a string representation of a CBOR blob
12+
// HumanReadable returns a string representation of a CBOR blob
1313
func HumanReadable(blob []byte) (string, error) {
1414
reader := bytes.NewReader(blob)
1515

0 commit comments

Comments
 (0)