From f863a189bb6315c13fecae0363c6612873e23f59 Mon Sep 17 00:00:00 2001 From: web3-bot <81333946+web3-bot@users.noreply.github.com> Date: Tue, 20 Apr 2021 13:03:59 -0400 Subject: [PATCH] sync: update CI config files (#25) --- .github/workflows/autorebase.yml | 25 ---------------------- .github/workflows/go-check.yml | 36 ++++++++++++++++++++++++++------ .github/workflows/go-test.yml | 8 +------ 3 files changed, 31 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/autorebase.yml diff --git a/.github/workflows/autorebase.yml b/.github/workflows/autorebase.yml deleted file mode 100644 index 2b2fb2e..0000000 --- a/.github/workflows/autorebase.yml +++ /dev/null @@ -1,25 +0,0 @@ -# File managed by web3-bot. DO NOT EDIT. -# See https://github.com/protocol/.github/ for details. - -# Allow PRs opened by web3-bot to be rebased by commenting "@web3-bot rebase" on the PR. - -on: - issue_comment: - types: [ created ] - -name: Automatic Rebase -jobs: - rebase: - name: Rebase - if: github.event.issue.pull_request != '' && github.event.issue.user.login == 'web3-bot' && contains(github.event.comment.body, '@web3-bot rebase') - runs-on: ubuntu-latest - steps: - - name: Checkout the latest code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - token: ${{ secrets.WEB3BOT_GITHUB_TOKEN }} - - name: Automatic Rebase - uses: cirrus-actions/rebase@7cea12ac34ab078fa37e87798d8986185afa7bf2 # v1.4 - env: - GITHUB_TOKEN: ${{ secrets.WEB3BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/go-check.yml b/.github/workflows/go-check.yml index 5557c50..8124473 100644 --- a/.github/workflows/go-check.yml +++ b/.github/workflows/go-check.yml @@ -1,5 +1,5 @@ -# Workflow managed by ipldbot. DO NOT EDIT. -# See https://github.com/ipld/.github/ for details. +# File managed by web3-bot. DO NOT EDIT. +# See https://github.com/protocol/.github/ for details. on: [push, pull_request] @@ -9,8 +9,32 @@ jobs: name: Go checks steps: - uses: actions/checkout@v2 - - name: golangci-lint - uses: golangci/golangci-lint-action@d9f0e73c0497685d68af8c58280f49fcaf0545ff # v2.5.1 + - uses: actions/setup-go@v2 with: - version: v1.33 - args: "--disable-all --enable gofmt,govet" + go-version: "1.16.x" + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@be534f007836a777104a15f2456cd1fffd3ddee8 # v2020.2.2 + - name: Check that go.mod is tidy + run: | + cp go.mod go.mod.orig + cp go.sum go.sum.orig + go mod tidy + diff go.mod go.mod.orig + diff go.sum go.sum.orig + - name: gofmt + if: ${{ success() || failure() }} # run this step even if the previous one failed + run: | + out=$(gofmt -s -l .) + if [[ -n "$out" ]]; then + echo $out | awk '{print "::error file=" $0 ",line=0,col=0::File is not gofmt-ed."}' + exit 1 + fi + - name: go vet + if: ${{ success() || failure() }} # run this step even if the previous one failed + run: go vet ./... + - name: staticcheck + if: ${{ success() || failure() }} # run this step even if the previous one failed + run: | + set -o pipefail + staticcheck ./... | sed -e 's@\(.*\)\.go@./\1.go@g' + diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 1bd78a7..f84b762 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -31,14 +31,8 @@ jobs: - name: Run tests with race detector if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow run: go test -v -race ./... - - name: Check if codecov.yml exists # only upload to Codecov if there's a codecov.yml - id: check_codecov - uses: andstor/file-existence-action@87d74d4732ddb824259d80c8a508c0124bf1c673 # v1.0.1 - with: - files: "codecov.yml" - name: Upload coverage to Codecov - if: steps.check_codecov.outputs.files_exists == 'true' - uses: codecov/codecov-action@e156083f13aff6830c92fc5faa23505779fbf649 # v1.2.1 + uses: codecov/codecov-action@fcebab03f26c7530a22baa63f06b3e0515f0c7cd # v1.3.1 with: file: coverage.txt env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }} -- GitLab