Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #10 from ipfs/web3-bot/sync
Browse files Browse the repository at this point in the history
sync: update CI config files
  • Loading branch information
galargh authored Sep 1, 2022
2 parents a83ea60 + 03a56e2 commit 1dd9da2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/go-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
env:
RUNGOGENERATE: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: "1.18.x"
go-version: "1.19.x"
- name: Run repo-specific setup
uses: ./.github/actions/go-check-setup
if: hashFiles('./.github/actions/go-check-setup') != ''
Expand All @@ -27,7 +27,7 @@ jobs:
echo "RUNGOGENERATE=true" >> $GITHUB_ENV
fi
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@d7e217c1ff411395475b2971c0824e1e7cc1af98 # 2022.1 (v0.3.0)
run: go install honnef.co/go/tools/cmd/staticcheck@376210a89477dedbe6fdc4484b233998650d7b3c # 2022.1.3 (v0.3.3)
- name: Check that go.mod is tidy
uses: protocol/multiple-go-modules@v1.2
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ jobs:
fail-fast: false
matrix:
os: [ "ubuntu", "windows", "macos" ]
go: [ "1.17.x", "1.18.x" ]
go: [ "1.18.x", "1.19.x" ]
env:
COVERAGES: ""
runs-on: ${{ format('{0}-latest', matrix.os) }}
name: ${{ matrix.os }} (go ${{ matrix.go }})
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Go information
Expand All @@ -43,7 +43,7 @@ jobs:
# Use -coverpkg=./..., so that we include cross-package coverage.
# If package ./A imports ./B, and ./A's tests also cover ./B,
# this means ./B's coverage will be significantly higher than 0%.
run: go test -v -coverprofile=module-coverage.txt -coverpkg=./... ./...
run: go test -v -shuffle=on -coverprofile=module-coverage.txt -coverpkg=./... ./...
- name: Run tests (32 bit)
if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX.
uses: protocol/multiple-go-modules@v1.2
Expand All @@ -52,7 +52,7 @@ jobs:
with:
run: |
export "PATH=${{ env.PATH_386 }}:$PATH"
go test -v ./...
go test -v -shuffle=on ./...
- name: Run tests with race detector
if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow
uses: protocol/multiple-go-modules@v1.2
Expand All @@ -62,7 +62,7 @@ jobs:
shell: bash
run: echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
- name: Upload coverage to Codecov
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
files: '${{ env.COVERAGES }}'
env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ require (
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb // indirect
)

go 1.17
go 1.18
3 changes: 1 addition & 2 deletions keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package keystore

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -112,7 +111,7 @@ func (ks *FSKeystore) Get(name string) (ci.PrivKey, error) {

kp := filepath.Join(ks.dir, name)

data, err := ioutil.ReadFile(kp)
data, err := os.ReadFile(kp)
if err != nil {
if os.IsNotExist(err) {
return nil, ErrNoSuchKey
Expand Down
13 changes: 6 additions & 7 deletions keystore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package keystore

import (
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
Expand All @@ -27,7 +26,7 @@ func privKeyOrFatal(t *testing.T) ci.PrivKey {
}

func TestKeystoreBasics(t *testing.T) {
tdir, err := ioutil.TempDir("", "keystore-test")
tdir, err := os.MkdirTemp("", "keystore-test")
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -146,7 +145,7 @@ func TestKeystoreBasics(t *testing.T) {
}

func TestInvalidKeyFiles(t *testing.T) {
tdir, err := ioutil.TempDir("", "keystore-test")
tdir, err := os.MkdirTemp("", "keystore-test")

if err != nil {
t.Fatal(err)
Expand All @@ -171,12 +170,12 @@ func TestInvalidKeyFiles(t *testing.T) {
t.Fatal(err)
}

err = ioutil.WriteFile(filepath.Join(ks.dir, encodedName), bytes, 0644)
err = os.WriteFile(filepath.Join(ks.dir, encodedName), bytes, 0644)
if err != nil {
t.Fatal(err)
}

err = ioutil.WriteFile(filepath.Join(ks.dir, "z.invalid"), bytes, 0644)
err = os.WriteFile(filepath.Join(ks.dir, "z.invalid"), bytes, 0644)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -205,7 +204,7 @@ func TestInvalidKeyFiles(t *testing.T) {
}

func TestNonExistingKey(t *testing.T) {
tdir, err := ioutil.TempDir("", "keystore-test")
tdir, err := os.MkdirTemp("", "keystore-test")
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -245,7 +244,7 @@ func assertGetKey(ks Keystore, name string, exp ci.PrivKey) error {
}

func assertDirContents(dir string, exp []string) error {
finfos, err := ioutil.ReadDir(dir)
finfos, err := os.ReadDir(dir)
if err != nil {
return err
}
Expand Down

0 comments on commit 1dd9da2

Please sign in to comment.