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

Commit

Permalink
sync: update CI config files (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
web3-bot authored Aug 25, 2022
1 parent fc16ce3 commit de3410b
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 53 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/[email protected]
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/[email protected]
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/[email protected]
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 }}
3 changes: 2 additions & 1 deletion block.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package iface

import (
"context"
path "github.com/ipfs/interface-go-ipfs-core/path"
"io"

path "github.com/ipfs/interface-go-ipfs-core/path"

"github.com/ipfs/interface-go-ipfs-core/options"
)

Expand Down
1 change: 1 addition & 0 deletions dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package iface

import (
"context"

path "github.com/ipfs/interface-go-ipfs-core/path"

"github.com/ipfs/interface-go-ipfs-core/options"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ require (
google.golang.org/protobuf v1.27.1 // indirect
)

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

import (
"context"

path "github.com/ipfs/interface-go-ipfs-core/path"

"github.com/ipfs/interface-go-ipfs-core/options"
Expand Down
1 change: 1 addition & 0 deletions name.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package iface
import (
"context"
"errors"

path "github.com/ipfs/interface-go-ipfs-core/path"

"github.com/ipfs/interface-go-ipfs-core/options"
Expand Down
3 changes: 2 additions & 1 deletion object.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package iface

import (
"context"
path "github.com/ipfs/interface-go-ipfs-core/path"
"io"

path "github.com/ipfs/interface-go-ipfs-core/path"

"github.com/ipfs/interface-go-ipfs-core/options"

"github.com/ipfs/go-cid"
Expand Down
2 changes: 1 addition & 1 deletion options/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (keyOpts) Type(algorithm string) KeyGenerateOption {
// generated. Default is -1
//
// value of -1 means 'use default size for key type':
// * 2048 for RSA
// - 2048 for RSA
func (keyOpts) Size(size int) KeyGenerateOption {
return func(settings *KeyGenerateSettings) error {
settings.Size = size
Expand Down
1 change: 0 additions & 1 deletion options/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ func (nameOpts) Cache(cache bool) NameResolveOption {
}
}

//
func (nameOpts) ResolveOption(opt ropts.ResolveOpt) NameResolveOption {
return func(settings *NameResolveSettings) error {
settings.ResolveOpts = append(settings.ResolveOpts, opt)
Expand Down
40 changes: 20 additions & 20 deletions options/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ func (pinLsOpts) Indirect() PinLsOption {
// type.
//
// Supported values:
// * "direct" - directly pinned objects
// * "recursive" - roots of recursive pins
// * "indirect" - indirectly pinned objects (referenced by recursively pinned
// objects)
// * "all" - all pinned objects (default)
// - "direct" - directly pinned objects
// - "recursive" - roots of recursive pins
// - "indirect" - indirectly pinned objects (referenced by recursively pinned
// objects)
// - "all" - all pinned objects (default)
func (pinLsOpts) Type(typeStr string) (PinLsOption, error) {
switch typeStr {
case "all", "direct", "indirect", "recursive":
Expand All @@ -182,11 +182,11 @@ func (pinLsOpts) Type(typeStr string) (PinLsOption, error) {
// be returned
//
// Supported values:
// * "direct" - directly pinned objects
// * "recursive" - roots of recursive pins
// * "indirect" - indirectly pinned objects (referenced by recursively pinned
// objects)
// * "all" - all pinned objects (default)
// - "direct" - directly pinned objects
// - "recursive" - roots of recursive pins
// - "indirect" - indirectly pinned objects (referenced by recursively pinned
// objects)
// - "all" - all pinned objects (default)
func (pinLsOpts) pinType(t string) PinLsOption {
return func(settings *PinLsSettings) error {
settings.Type = t
Expand Down Expand Up @@ -224,11 +224,11 @@ func (pinIsPinnedOpts) Indirect() PinIsPinnedOption {
// type.
//
// Supported values:
// * "direct" - directly pinned objects
// * "recursive" - roots of recursive pins
// * "indirect" - indirectly pinned objects (referenced by recursively pinned
// objects)
// * "all" - all pinned objects (default)
// - "direct" - directly pinned objects
// - "recursive" - roots of recursive pins
// - "indirect" - indirectly pinned objects (referenced by recursively pinned
// objects)
// - "all" - all pinned objects (default)
func (pinIsPinnedOpts) Type(typeStr string) (PinIsPinnedOption, error) {
switch typeStr {
case "all", "direct", "indirect", "recursive":
Expand All @@ -242,11 +242,11 @@ func (pinIsPinnedOpts) Type(typeStr string) (PinIsPinnedOption, error) {
// pin is expected to be, speeding up the research.
//
// Supported values:
// * "direct" - directly pinned objects
// * "recursive" - roots of recursive pins
// * "indirect" - indirectly pinned objects (referenced by recursively pinned
// objects)
// * "all" - all pinned objects (default)
// - "direct" - directly pinned objects
// - "recursive" - roots of recursive pins
// - "indirect" - indirectly pinned objects (referenced by recursively pinned
// objects)
// - "all" - all pinned objects (default)
func (pinIsPinnedOpts) pinType(t string) PinIsPinnedOption {
return func(settings *PinIsPinnedSettings) error {
settings.WithType = t
Expand Down
2 changes: 1 addition & 1 deletion path/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
// * /ipfs - Immutable unixfs path (files)
// * /ipld - Immutable ipld path (data)
// * /ipns - Mutable names. Usually resolves to one of the immutable paths
//TODO: /local (MFS)
// TODO: /local (MFS)
type Path interface {
// String returns the path as a string.
String() string
Expand Down
1 change: 1 addition & 0 deletions pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package iface

import (
"context"

path "github.com/ipfs/interface-go-ipfs-core/path"

"github.com/ipfs/interface-go-ipfs-core/options"
Expand Down
5 changes: 2 additions & 3 deletions tests/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"context"
"io"
"io/ioutil"
"strings"
"testing"

Expand Down Expand Up @@ -211,7 +210,7 @@ func (tp *TestSuite) TestBlockGet(t *testing.T) {
t.Fatal(err)
}

d, err := ioutil.ReadAll(r)
d, err := io.ReadAll(r)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -249,7 +248,7 @@ func (tp *TestSuite) TestBlockRm(t *testing.T) {
t.Fatal(err)
}

d, err := ioutil.ReadAll(r)
d, err := io.ReadAll(r)
if err != nil {
t.Fatal(err)
}
Expand Down
3 changes: 2 additions & 1 deletion tests/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package tests

import (
"context"
path "github.com/ipfs/interface-go-ipfs-core/path"
"math"
gopath "path"
"strings"
"testing"

path "github.com/ipfs/interface-go-ipfs-core/path"

coreiface "github.com/ipfs/interface-go-ipfs-core"

ipldcbor "github.com/ipfs/go-ipld-cbor"
Expand Down
10 changes: 5 additions & 5 deletions tests/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"bytes"
"context"
"encoding/hex"
"io/ioutil"
"io"
"strings"
"testing"

"github.com/ipfs/interface-go-ipfs-core"
iface "github.com/ipfs/interface-go-ipfs-core"
opt "github.com/ipfs/interface-go-ipfs-core/options"
)

Expand Down Expand Up @@ -143,7 +143,7 @@ func (tp *TestSuite) TestObjectData(t *testing.T) {
t.Fatal(err)
}

data, err := ioutil.ReadAll(r)
data, err := io.ReadAll(r)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -383,7 +383,7 @@ func (tp *TestSuite) TestObjectAddData(t *testing.T) {
t.Fatal(err)
}

data, err := ioutil.ReadAll(r)
data, err := io.ReadAll(r)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -416,7 +416,7 @@ func (tp *TestSuite) TestObjectSetData(t *testing.T) {
t.Fatal(err)
}

data, err := ioutil.ReadAll(r)
data, err := io.ReadAll(r)
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"testing"

"github.com/ipfs/interface-go-ipfs-core"
iface "github.com/ipfs/interface-go-ipfs-core"
opt "github.com/ipfs/interface-go-ipfs-core/options"
"github.com/ipfs/interface-go-ipfs-core/path"

Expand Down
2 changes: 1 addition & 1 deletion tests/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/ipfs/interface-go-ipfs-core"
iface "github.com/ipfs/interface-go-ipfs-core"
"github.com/ipfs/interface-go-ipfs-core/options"
)

Expand Down
9 changes: 4 additions & 5 deletions tests/unixfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"math"
"math/rand"
"os"
Expand Down Expand Up @@ -113,7 +112,7 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
return path.IpfsPath(c)
}

rf, err := ioutil.TempFile(os.TempDir(), "unixfs-add-real")
rf, err := os.CreateTemp(os.TempDir(), "unixfs-add-real")
if err != nil {
t.Fatal(err)
}
Expand All @@ -134,7 +133,7 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
defer os.Remove(rfp)

realFile := func() files.Node {
n, err := files.NewReaderPathFile(rfp, ioutil.NopCloser(strings.NewReader(helloStr)), stat)
n, err := files.NewReaderPathFile(rfp, io.NopCloser(strings.NewReader(helloStr)), stat)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -474,12 +473,12 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
defer orig.Close()
defer got.Close()

do, err := ioutil.ReadAll(orig.(files.File))
do, err := io.ReadAll(orig.(files.File))
if err != nil {
t.Fatal(err)
}

dg, err := ioutil.ReadAll(got.(files.File))
dg, err := io.ReadAll(got.(files.File))
if err != nil {
t.Fatal(err)
}
Expand Down
3 changes: 2 additions & 1 deletion unixfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package iface

import (
"context"

"github.com/ipfs/interface-go-ipfs-core/options"
path "github.com/ipfs/interface-go-ipfs-core/path"

"github.com/ipfs/go-cid"
"github.com/ipfs/go-ipfs-files"
files "github.com/ipfs/go-ipfs-files"
)

type AddEvent struct {
Expand Down

0 comments on commit de3410b

Please sign in to comment.