Skip to content
This repository was archived by the owner on Oct 5, 2023. It is now read-only.

Commit 8569e83

Browse files
authored
Merge pull request #144 from ipfs/web3-bot/sync
sync: update CI config files chore: update deps
2 parents 77dc6b8 + bd0dd3e commit 8569e83

File tree

7 files changed

+724
-211
lines changed

7 files changed

+724
-211
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: installipfs
2+
description: install go-ipfs
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Step 1
8+
shell: bash
9+
run: (cd /tmp && go install github.com/ipfs/go-ipfs/cmd/ipfs@master)

.github/workflows/automerge.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# File managed by web3-bot. DO NOT EDIT.
2+
# See https://github.com/protocol/.github/ for details.
3+
4+
# Automatically merge pull requests opened by web3-bot, as soon as (and only if) all tests pass.
5+
# This reduces the friction associated with updating with our workflows.
6+
7+
on: [ pull_request ]
8+
name: Automerge
9+
10+
jobs:
11+
automerge-check:
12+
if: github.event.pull_request.user.login == 'web3-bot'
13+
runs-on: ubuntu-latest
14+
outputs:
15+
status: ${{ steps.should-automerge.outputs.status }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
- name: Check if we should automerge
21+
id: should-automerge
22+
run: |
23+
for commit in $(git rev-list --first-parent origin/${{ github.event.pull_request.base.ref }}..${{ github.event.pull_request.head.sha }}); do
24+
committer=$(git show --format=$'%ce' -s $commit)
25+
echo "Committer: $committer"
26+
if [[ "$committer" != "[email protected]" ]]; then
27+
echo "Commit $commit wasn't committed by web3-bot, but by $committer."
28+
echo "::set-output name=status::false"
29+
exit
30+
fi
31+
done
32+
echo "::set-output name=status::true"
33+
automerge:
34+
needs: automerge-check
35+
runs-on: ubuntu-latest
36+
# The check for the user is redundant here, as this job depends on the automerge-check job,
37+
# but it prevents this job from spinning up, just to be skipped shortly after.
38+
if: github.event.pull_request.user.login == 'web3-bot' && needs.automerge-check.outputs.status == 'true'
39+
steps:
40+
- name: Wait on tests
41+
uses: lewagon/wait-on-check-action@bafe56a6863672c681c3cf671f5e10b20abf2eaa # v0.2
42+
with:
43+
ref: ${{ github.event.pull_request.head.sha }}
44+
repo-token: ${{ secrets.GITHUB_TOKEN }}
45+
wait-interval: 10
46+
running-workflow-name: 'automerge' # the name of this job
47+
- name: Merge PR
48+
uses: pascalgn/automerge-action@741c311a47881be9625932b0a0de1b0937aab1ae # v0.13.1
49+
env:
50+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
51+
MERGE_LABELS: ""
52+
MERGE_METHOD: "squash"
53+
MERGE_DELETE_BRANCH: true

.github/workflows/go-check.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# File managed by web3-bot. DO NOT EDIT.
2+
# See https://github.com/protocol/.github/ for details.
3+
4+
on: [push, pull_request]
5+
name: Go Checks
6+
7+
jobs:
8+
unit:
9+
runs-on: ubuntu-latest
10+
name: All
11+
env:
12+
RUNGOGENERATE: false
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
submodules: recursive
17+
- uses: actions/setup-go@v2
18+
with:
19+
go-version: "1.17.x"
20+
- name: Run repo-specific setup
21+
uses: ./.github/actions/go-check-setup
22+
if: hashFiles('./.github/actions/go-check-setup') != ''
23+
- name: Read config
24+
if: hashFiles('./.github/workflows/go-check-config.json') != ''
25+
run: |
26+
if jq -re .gogenerate ./.github/workflows/go-check-config.json; then
27+
echo "RUNGOGENERATE=true" >> $GITHUB_ENV
28+
fi
29+
- name: Install staticcheck
30+
run: go install honnef.co/go/tools/cmd/staticcheck@df71e5d0e0ed317ebf43e6e59cf919430fa4b8f2 # 2021.1.1 (v0.2.1)
31+
- name: Check that go.mod is tidy
32+
uses: protocol/[email protected]
33+
with:
34+
run: |
35+
go mod tidy
36+
if [[ -n $(git ls-files --other --exclude-standard --directory -- go.sum) ]]; then
37+
echo "go.sum was added by go mod tidy"
38+
exit 1
39+
fi
40+
git diff --exit-code -- go.sum go.mod
41+
- name: gofmt
42+
if: ${{ success() || failure() }} # run this step even if the previous one failed
43+
run: |
44+
out=$(gofmt -s -l .)
45+
if [[ -n "$out" ]]; then
46+
echo $out | awk '{print "::error file=" $0 ",line=0,col=0::File is not gofmt-ed."}'
47+
exit 1
48+
fi
49+
- name: go vet
50+
if: ${{ success() || failure() }} # run this step even if the previous one failed
51+
uses: protocol/[email protected]
52+
with:
53+
run: go vet ./...
54+
- name: staticcheck
55+
if: ${{ success() || failure() }} # run this step even if the previous one failed
56+
uses: protocol/[email protected]
57+
with:
58+
run: |
59+
set -o pipefail
60+
staticcheck ./... | sed -e 's@\(.*\)\.go@./\1.go@g'
61+
- name: go generate
62+
uses: protocol/[email protected]
63+
if: (success() || failure()) && env.RUNGOGENERATE == 'true'
64+
with:
65+
run: |
66+
git clean -fd # make sure there aren't untracked files / directories
67+
go generate ./...
68+
# check if go generate modified or added any files
69+
if ! $(git add . && git diff-index HEAD --exit-code --quiet); then
70+
echo "go generated caused changes to the repository:"
71+
git status --short
72+
exit 1
73+
fi
74+

.github/workflows/go-test.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# File managed by web3-bot. DO NOT EDIT.
2+
# See https://github.com/protocol/.github/ for details.
3+
4+
on: [push, pull_request]
5+
name: Go Test
6+
7+
jobs:
8+
unit:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: [ "ubuntu", "windows", "macos" ]
13+
go: [ "1.16.x", "1.17.x" ]
14+
env:
15+
COVERAGES: ""
16+
runs-on: ${{ matrix.os }}-latest
17+
name: ${{ matrix.os}} (go ${{ matrix.go }})
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
submodules: recursive
22+
- uses: actions/setup-go@v2
23+
with:
24+
go-version: ${{ matrix.go }}
25+
- name: Go information
26+
run: |
27+
go version
28+
go env
29+
- name: Run repo-specific setup
30+
uses: ./.github/actions/go-test-setup
31+
if: hashFiles('./.github/actions/go-test-setup') != ''
32+
- name: Run tests
33+
uses: protocol/[email protected]
34+
with:
35+
run: go test -v -coverprofile module-coverage.txt ./...
36+
- name: Run tests (32 bit)
37+
if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX.
38+
uses: protocol/[email protected]
39+
env:
40+
GOARCH: 386
41+
with:
42+
run: go test -v ./...
43+
- name: Run tests with race detector
44+
if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow
45+
uses: protocol/[email protected]
46+
with:
47+
run: go test -v -race ./...
48+
- name: Collect coverage files
49+
shell: bash
50+
run: echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
51+
- name: Upload coverage to Codecov
52+
uses: codecov/codecov-action@51d810878be5422784e86451c0e7c14e5860ec47 # v2.0.2
53+
with:
54+
files: '${{ env.COVERAGES }}'
55+
env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }}

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

go.mod

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
module github.com/ipfs/go-ipfs-http-client
22

33
require (
4-
github.com/ipfs/go-block-format v0.0.2
4+
github.com/ipfs/go-block-format v0.0.3
55
github.com/ipfs/go-cid v0.0.7
6-
github.com/ipfs/go-ipfs-cmds v0.3.0
6+
github.com/ipfs/go-ipfs-cmds v0.6.0
77
github.com/ipfs/go-ipfs-files v0.0.8
88
github.com/ipfs/go-ipld-format v0.2.0
9-
github.com/ipfs/go-merkledag v0.3.2
10-
github.com/ipfs/go-path v0.0.7
11-
github.com/ipfs/go-unixfs v0.2.4
12-
github.com/ipfs/interface-go-ipfs-core v0.4.0
9+
github.com/ipfs/go-merkledag v0.4.0
10+
github.com/ipfs/go-path v0.1.1
11+
github.com/ipfs/go-unixfs v0.2.5
12+
github.com/ipfs/interface-go-ipfs-core v0.5.2
1313
github.com/ipfs/iptb v1.4.0
1414
github.com/ipfs/iptb-plugins v0.3.0
15-
github.com/libp2p/go-libp2p-core v0.6.1
15+
github.com/libp2p/go-libp2p-core v0.8.6
1616
github.com/mitchellh/go-homedir v1.1.0
17-
github.com/multiformats/go-multiaddr v0.3.0
18-
github.com/multiformats/go-multiaddr-net v0.2.0
19-
github.com/multiformats/go-multihash v0.0.14
17+
github.com/multiformats/go-multiaddr v0.3.3
18+
github.com/multiformats/go-multihash v0.0.15
2019
github.com/pkg/errors v0.9.1
2120
)
2221

23-
go 1.13
22+
go 1.16

0 commit comments

Comments
 (0)