Move testing pipeline to github actions.

Since travis cannot stop sucking.
This commit is contained in:
Hector Sanjuan 2021-10-20 16:30:03 +02:00
parent af9313d4fe
commit 066b1f4514
2 changed files with 126 additions and 53 deletions

126
.github/workflows/tests.yml vendored Normal file
View File

@ -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

View File

@ -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