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 #21 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 Aug 31, 2022
2 parents 9ca44c2 + 61e9e65 commit 89b6bbd
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 34 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 }}
5 changes: 3 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package main
import (
"context"
"fmt"
"github.com/ipfs/go-cid"
pinclient "github.com/ipfs/go-pinning-service-http-client"
"os"
"time"

"github.com/ipfs/go-cid"
pinclient "github.com/ipfs/go-pinning-service-http-client"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ipfs/go-pinning-service-http-client

go 1.17
go 1.18

require (
github.com/ipfs/go-cid v0.1.0
Expand Down
3 changes: 2 additions & 1 deletion model.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package go_pinning_service_http_client
import (
"encoding/json"
"fmt"
"time"

"github.com/ipfs/go-cid"
"github.com/ipfs/go-pinning-service-http-client/openapi"
"github.com/multiformats/go-multiaddr"
"time"
)

// PinGetter Getter for Pin object
Expand Down
46 changes: 27 additions & 19 deletions openapi/api_pins.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package openapi

import (
_context "context"
_ioutil "io/ioutil"
_io "io"
_nethttp "net/http"
_neturl "net/url"
"strings"
Expand Down Expand Up @@ -76,7 +76,8 @@ func (r apiPinsGetRequest) Meta(meta map[string]string) apiPinsGetRequest {
/*
PinsGet List pin objects
List all the pin objects, matching optional filters; when no filter is provided, only successful pins are returned
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return apiPinsGetRequest
*/
func (a *PinsApiService) PinsGet(ctx _context.Context) apiPinsGetRequest {
Expand All @@ -88,7 +89,8 @@ func (a *PinsApiService) PinsGet(ctx _context.Context) apiPinsGetRequest {

/*
Execute executes the request
@return PinResults
@return PinResults
*/
func (r apiPinsGetRequest) Execute() (PinResults, *_nethttp.Response, error) {
var (
Expand Down Expand Up @@ -159,7 +161,7 @@ func (r apiPinsGetRequest) Execute() (PinResults, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := _io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
Expand Down Expand Up @@ -209,7 +211,8 @@ func (r apiPinsPostRequest) Pin(pin Pin) apiPinsPostRequest {
/*
PinsPost Add pin object
Add a new pin object for the current access token
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return apiPinsPostRequest
*/
func (a *PinsApiService) PinsPost(ctx _context.Context) apiPinsPostRequest {
Expand All @@ -221,7 +224,8 @@ func (a *PinsApiService) PinsPost(ctx _context.Context) apiPinsPostRequest {

/*
Execute executes the request
@return PinStatus
@return PinStatus
*/
func (r apiPinsPostRequest) Execute() (PinStatus, *_nethttp.Response, error) {
var (
Expand Down Expand Up @@ -277,7 +281,7 @@ func (r apiPinsPostRequest) Execute() (PinStatus, *_nethttp.Response, error) {
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := _io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
Expand Down Expand Up @@ -322,8 +326,9 @@ type apiPinsRequestidDeleteRequest struct {
/*
PinsRequestidDelete Remove pin object
Remove a pin object
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param requestid
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param requestid
@return apiPinsRequestidDeleteRequest
*/
func (a *PinsApiService) PinsRequestidDelete(ctx _context.Context, requestid string) apiPinsRequestidDeleteRequest {
Expand All @@ -336,7 +341,6 @@ func (a *PinsApiService) PinsRequestidDelete(ctx _context.Context, requestid str

/*
Execute executes the request
*/
func (r apiPinsRequestidDeleteRequest) Execute() (*_nethttp.Response, error) {
var (
Expand Down Expand Up @@ -386,7 +390,7 @@ func (r apiPinsRequestidDeleteRequest) Execute() (*_nethttp.Response, error) {
return localVarHTTPResponse, err
}

localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := _io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarHTTPResponse, err
Expand Down Expand Up @@ -422,8 +426,9 @@ type apiPinsRequestidGetRequest struct {
/*
PinsRequestidGet Get pin object
Get a pin object and its status
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param requestid
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param requestid
@return apiPinsRequestidGetRequest
*/
func (a *PinsApiService) PinsRequestidGet(ctx _context.Context, requestid string) apiPinsRequestidGetRequest {
Expand All @@ -436,7 +441,8 @@ func (a *PinsApiService) PinsRequestidGet(ctx _context.Context, requestid string

/*
Execute executes the request
@return PinStatus
@return PinStatus
*/
func (r apiPinsRequestidGetRequest) Execute() (PinStatus, *_nethttp.Response, error) {
var (
Expand Down Expand Up @@ -487,7 +493,7 @@ func (r apiPinsRequestidGetRequest) Execute() (PinStatus, *_nethttp.Response, er
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := _io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
Expand Down Expand Up @@ -538,8 +544,9 @@ func (r apiPinsRequestidPostRequest) Pin(pin Pin) apiPinsRequestidPostRequest {
/*
PinsRequestidPost Replace pin object
Replace an existing pin object (shortcut for executing remove and add operations in one step to avoid unnecessary garbage collection of blocks present in both recursive pins)
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param requestid
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param requestid
@return apiPinsRequestidPostRequest
*/
func (a *PinsApiService) PinsRequestidPost(ctx _context.Context, requestid string) apiPinsRequestidPostRequest {
Expand All @@ -552,7 +559,8 @@ func (a *PinsApiService) PinsRequestidPost(ctx _context.Context, requestid strin

/*
Execute executes the request
@return PinStatus
@return PinStatus
*/
func (r apiPinsRequestidPostRequest) Execute() (PinStatus, *_nethttp.Response, error) {
var (
Expand Down Expand Up @@ -609,7 +617,7 @@ func (r apiPinsRequestidPostRequest) Execute() (PinStatus, *_nethttp.Response, e
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := _io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
Expand Down
3 changes: 2 additions & 1 deletion openapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"encoding/xml"
"errors"
"fmt"
"golang.org/x/oauth2"
"io"
"log"
"mime/multipart"
Expand All @@ -29,6 +28,8 @@ import (
"regexp"
"strings"
"time"

"golang.org/x/oauth2"
)

var (
Expand Down

0 comments on commit 89b6bbd

Please sign in to comment.