mirror of https://github.com/poanetwork/quorum.git
116 lines
3.8 KiB
YAML
116 lines
3.8 KiB
YAML
name: Pull Request Check
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- '**.md'
|
|
- .gitignore
|
|
env:
|
|
GO_VERSION: 1.13
|
|
jobs:
|
|
lint:
|
|
name: 'Code linters'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 'Setup Go ${{ env.GO_VERSION }}'
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
- name: 'Check out project files'
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: false
|
|
- name: 'Prepare environment'
|
|
run: |
|
|
echo "::add-path::$(go env GOPATH)/bin"
|
|
- name: 'Run code linters'
|
|
run: |
|
|
GO111MODULE=off make lint
|
|
unit-tests:
|
|
name: 'Unit tests in ${{ matrix.os }}'
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ["ubuntu-latest"]
|
|
env:
|
|
QUORUM_IGNORE_TEST_PACKAGES: github.com/ethereum/go-ethereum/les,github.com/ethereum/go-ethereum/les/flowcontrol,github.com/ethereum/go-ethereum/mobile
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: 'Setup Go ${{ env.GO_VERSION }}'
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
- name: 'Check out project files'
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: recursive
|
|
- name: 'Prepare environment'
|
|
run: |
|
|
# https://github.com/actions/virtual-environments/issues/798
|
|
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
|
|
|
|
echo "::add-path::$(go env GOPATH)/bin"
|
|
- name: 'Run unit tests'
|
|
run: |
|
|
make test
|
|
docker-build:
|
|
name: 'Build Docker image'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 'Check out project files'
|
|
uses: actions/checkout@v2
|
|
- name: 'Build docker image'
|
|
id: build
|
|
run: |
|
|
output_dir=${{ runner.temp }}/docker
|
|
mkdir -p $output_dir
|
|
docker build -t quorumengineering/quorum:pr .
|
|
docker save quorumengineering/quorum:pr > quorum-pr.tar
|
|
tar cfvz $output_dir/quorum-pr.tar.gz quorum-pr.tar
|
|
echo "::set-output name=output_dir::$output_dir"
|
|
- name: 'Upload workflow artifact - Docker image'
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: docker-image
|
|
path: ${{ steps.build.outputs.output_dir }}
|
|
acceptance-tests:
|
|
name: Acceptance tests (${{ matrix.tag }})
|
|
needs:
|
|
- docker-build
|
|
if: success()
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# list of tag expression being executed in parallel
|
|
# for PR, only selective tests are run.
|
|
# More comprehensive suites are scheduled to run in master
|
|
tag:
|
|
- 'basic || basic-raft || (advanced && raft) || networks/typical::raft'
|
|
- 'basic || basic-istanbul || (advanced && istanbul && !block-heights) || networks/typical::istanbul'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 'Download workflow artifact - Docker image'
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: docker-image
|
|
- name: 'Load Docker image'
|
|
id: setup
|
|
run: |
|
|
tar xfvz docker-image/quorum-pr.tar.gz
|
|
docker load --input quorum-pr.tar
|
|
echo "::set-output name=outputDir::${{ runner.temp }}"
|
|
- name: 'Run acceptance tests'
|
|
run: |
|
|
docker run --rm \
|
|
--network host \
|
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
|
-v ${{ steps.setup.outputs.outputDir }}:${{ steps.setup.outputs.outputDir }} \
|
|
-e TF_VAR_quorum_docker_image='{ name = "quorumengineering/quorum:pr", local = true }' \
|
|
quorumengineering/acctests:latest test \
|
|
-Pauto \
|
|
-Dauto.outputDir=${{ steps.setup.outputs.outputDir }} \
|
|
-Dtags="${{ matrix.tag }}"
|
|
- name: 'Debug'
|
|
run: |
|
|
docker images
|
|
docker ps -a |