From 066b1f45149951a6448cdb42a9332cfe0466e32b Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 20 Oct 2021 16:30:03 +0200 Subject: [PATCH] Move testing pipeline to github actions. Since travis cannot stop sucking. --- .github/workflows/tests.yml | 126 ++++++++++++++++++++++++++++++++++++ .travis.yml | 53 --------------- 2 files changed, 126 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..cd12661da --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,126 @@ +name: Tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master, dependency-upgrades ] + +env: + GO: 1.16 + +jobs: + tests-all: + name: "All modules + Coverage" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO }} + + - name: "Tests" + run: go test -v -timeout 15m -coverprofile=coverage.txt -covermode=atomic ./... + + - name: "Coverage" + run: bash <(curl -s https://codecov.io/bash) + + tests-raft: + name: "Using Raft" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO }} + + - name: "Tests" + run: go test -v -timeout 15m -failfast -consensus raft . + + tests-leveldb: + name: "Using LevelDB" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO }} + + - name: "Tests" + run: go test -v -timeout 15m -failfast -datastore leveldb . + + tests-check: + name: "Build and syntax checks" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO }} + + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@latest + + - name: Check + run: make check + + - name: Build binaries + run: make build + + tests-docker: + name: "Docker and Compose build" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: Docker builds + run: make docker + + - name: Docker compose + run: make docker-compose + + sharness: + name: Sharness + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO }} + + - name: Apt-get update + run: sudo apt-get update + + - name: Install jq and curl + run: sudo apt-get install -y jq curl + + - name: Make install + run: make install + + - name: Pull go-ipfs + run: docker pull ipfs/go-ipfs + + - name: Sharness + run: make test_sharness diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c1879e223..000000000 --- a/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -language: go -os: - - linux -# - osx -go: -- '1.16.x' -services: -- docker - -sudo: required - -cache: - directories: - - $GOPATH/pkg/mod - - $HOME/.cache/go-build - -install: true - -env: - - GO111MODULE=on - -jobs: - include: - - stage: "Testing stage" - name: "Tests (all modules) + Coverage" - script: - - travis_wait go test -v -timeout 15m -coverprofile=coverage.txt -covermode=atomic ./... - after_success: - - bash <(curl -s https://codecov.io/bash) - - name: "Main Tests with raft consensus" - script: - - travis_wait go test -v -timeout 15m -failfast -consensus raft . - - name: "Main Tests with leveldb backend" - script: - - travis_wait go test -v -timeout 15m -failfast -datastore leveldb . - - name: "Golint, go vet, binary builds" - script: - - go install honnef.co/go/tools/cmd/staticcheck@latest - - make check - - make service - - make ctl - - make follow - - name: "Docker and Compose build" - script: - - make docker - - make docker-compose - - name: "Sharness" - script: - - sudo apt-get update - - sudo apt-get install -y jq curl - - make install - - docker pull ipfs/go-ipfs - - make test_sharness && make clean_sharness