Skip to content

Commit 3fa7c01

Browse files
authored
sync: update CI config files (#19)
1 parent b185ff6 commit 3fa7c01

File tree

6 files changed

+149
-38
lines changed

6 files changed

+149
-38
lines changed

Diff for: .github/workflows/automerge.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
if: ${{ needs.automerge-check.outputs.status == 'true' }}
37+
steps:
38+
- name: Wait on tests
39+
uses: lewagon/wait-on-check-action@bafe56a6863672c681c3cf671f5e10b20abf2eaa # v0.2
40+
with:
41+
ref: ${{ github.event.pull_request.head.sha }}
42+
repo-token: ${{ secrets.GITHUB_TOKEN }}
43+
wait-interval: 10
44+
running-workflow-name: 'automerge' # the name of this job
45+
- name: Merge PR
46+
uses: pascalgn/automerge-action@741c311a47881be9625932b0a0de1b0937aab1ae # v0.13.1
47+
env:
48+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
49+
MERGE_LABELS: ""
50+
MERGE_METHOD: "squash"
51+
MERGE_DELETE_BRANCH: true

Diff for: .github/workflows/go-check.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
submodules: recursive
15+
- uses: actions/setup-go@v2
16+
with:
17+
go-version: "1.16.x"
18+
- name: Install staticcheck
19+
run: go install honnef.co/go/tools/cmd/staticcheck@434f5f3816b358fe468fa83dcba62d794e7fe04b # 2021.1 (v0.2.0)
20+
- name: Check that go.mod is tidy
21+
uses: protocol/[email protected]
22+
with:
23+
run: |
24+
go mod tidy
25+
if [[ -n $(git ls-files --other --exclude-standard --directory -- go.sum) ]]; then
26+
echo "go.sum was added by go mod tidy"
27+
exit 1
28+
fi
29+
git diff --exit-code -- go.sum go.mod
30+
- name: gofmt
31+
if: ${{ success() || failure() }} # run this step even if the previous one failed
32+
run: |
33+
out=$(gofmt -s -l .)
34+
if [[ -n "$out" ]]; then
35+
echo $out | awk '{print "::error file=" $0 ",line=0,col=0::File is not gofmt-ed."}'
36+
exit 1
37+
fi
38+
- name: go vet
39+
if: ${{ success() || failure() }} # run this step even if the previous one failed
40+
uses: protocol/[email protected]
41+
with:
42+
run: go vet ./...
43+
- name: staticcheck
44+
if: ${{ success() || failure() }} # run this step even if the previous one failed
45+
uses: protocol/[email protected]
46+
with:
47+
run: |
48+
set -o pipefail
49+
staticcheck ./... | sed -e 's@\(.*\)\.go@./\1.go@g'
50+

Diff for: .github/workflows/go-test.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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.15.x", "1.16.x" ]
14+
runs-on: ${{ matrix.os }}-latest
15+
name: ${{ matrix.os}} (go ${{ matrix.go }})
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
submodules: recursive
20+
- uses: actions/setup-go@v2
21+
with:
22+
go-version: ${{ matrix.go }}
23+
- name: Go information
24+
run: |
25+
go version
26+
go env
27+
- name: Run tests
28+
uses: protocol/[email protected]
29+
with:
30+
run: go test -v -coverprofile coverage.txt ./...
31+
- name: Run tests (32 bit)
32+
if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX.
33+
uses: protocol/[email protected]
34+
env:
35+
GOARCH: 386
36+
with:
37+
run: go test -v ./...
38+
- name: Run tests with race detector
39+
if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow
40+
uses: protocol/[email protected]
41+
with:
42+
run: go test -v -race ./...
43+
- name: Upload coverage to Codecov
44+
uses: codecov/codecov-action@a1ed4b322b4b38cb846afb5a0ebfa17086917d27 # v1.5.0
45+
with:
46+
file: coverage.txt
47+
env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }}

Diff for: .travis.yml

-31
This file was deleted.

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/multiformats/go-multiaddr-fmt
22

33
require github.com/multiformats/go-multiaddr v0.2.1
44

5-
go 1.13
5+
go 1.15

Diff for: go.sum

-6
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@ github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0
22
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ=
33
github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771 h1:MHkK1uRtFbVqvAgvWxafZe54+5uBxLluGylDiKgdhwo=
44
github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
5-
github.com/mr-tron/base58 v1.1.2 h1:ZEw4I2EgPKDJ2iEw0cNmLB3ROrEmkOtXIkaG7wZg+78=
6-
github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
75
github.com/mr-tron/base58 v1.1.3 h1:v+sk57XuaCKGXpWtVBX8YJzO7hMGx4Aajh4TQbdEFdc=
86
github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
9-
github.com/multiformats/go-multiaddr v0.1.1 h1:rVAztJYMhCQ7vEFr8FvxW3mS+HF2eY/oPbOMeS0ZDnE=
10-
github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo=
117
github.com/multiformats/go-multiaddr v0.2.1 h1:SgG/cw5vqyB5QQe5FPe2TqggU9WtrA9X4nZw7LlVqOI=
128
github.com/multiformats/go-multiaddr v0.2.1/go.mod h1:s/Apk6IyxfvMjDafnhJgJ3/46z7tZ04iMk5wP4QMGGE=
13-
github.com/multiformats/go-multihash v0.0.8 h1:wrYcW5yxSi3dU07n5jnuS5PrNwyHy0zRHGVoUugWvXg=
14-
github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew=
159
github.com/multiformats/go-multihash v0.0.13 h1:06x+mk/zj1FoMsgNejLpy6QTvJqlSt/BhLEy87zidlc=
1610
github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc=
1711
github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=

0 commit comments

Comments
 (0)