github.com/ConsenSys/Quorum@v20.10.0+incompatible/.github/workflows/pr.yml (about) 1 name: Pull Request Check 2 on: 3 pull_request: 4 paths-ignore: 5 - 'docs/**' 6 - '**.md' 7 - .gitignore 8 env: 9 GO_VERSION: 1.13 10 jobs: 11 lint: 12 name: 'Code linters' 13 runs-on: ubuntu-latest 14 steps: 15 - name: 'Setup Go ${{ env.GO_VERSION }}' 16 uses: actions/setup-go@v1 17 with: 18 go-version: ${{ env.GO_VERSION }} 19 - name: 'Check out project files' 20 uses: actions/checkout@v2 21 with: 22 submodules: false 23 - name: 'Prepare environment' 24 run: | 25 echo "::add-path::$(go env GOPATH)/bin" 26 - name: 'Run code linters' 27 run: | 28 GO111MODULE=off make lint 29 unit-tests: 30 name: 'Unit tests in ${{ matrix.os }}' 31 strategy: 32 fail-fast: false 33 matrix: 34 os: ["ubuntu-latest"] 35 env: 36 QUORUM_IGNORE_TEST_PACKAGES: github.com/ethereum/go-ethereum/les,github.com/ethereum/go-ethereum/les/flowcontrol,github.com/ethereum/go-ethereum/mobile 37 runs-on: ${{ matrix.os }} 38 steps: 39 - name: 'Setup Go ${{ env.GO_VERSION }}' 40 uses: actions/setup-go@v1 41 with: 42 go-version: ${{ env.GO_VERSION }} 43 - name: 'Check out project files' 44 uses: actions/checkout@v2 45 with: 46 submodules: recursive 47 - name: 'Prepare environment' 48 run: | 49 # https://github.com/actions/virtual-environments/issues/798 50 sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf 51 52 echo "::add-path::$(go env GOPATH)/bin" 53 - name: 'Run unit tests' 54 run: | 55 make test 56 docker-build: 57 name: 'Build Docker image' 58 runs-on: ubuntu-latest 59 steps: 60 - name: 'Check out project files' 61 uses: actions/checkout@v2 62 - name: 'Build docker image' 63 id: build 64 run: | 65 output_dir=${{ runner.temp }}/docker 66 mkdir -p $output_dir 67 docker build -t quorumengineering/quorum:pr . 68 docker save quorumengineering/quorum:pr > quorum-pr.tar 69 tar cfvz $output_dir/quorum-pr.tar.gz quorum-pr.tar 70 echo "::set-output name=output_dir::$output_dir" 71 - name: 'Upload workflow artifact - Docker image' 72 uses: actions/upload-artifact@v1 73 with: 74 name: docker-image 75 path: ${{ steps.build.outputs.output_dir }} 76 acceptance-tests: 77 name: Acceptance tests (${{ matrix.tag }}) 78 needs: 79 - docker-build 80 if: success() 81 strategy: 82 fail-fast: false 83 matrix: 84 # list of tag expression being executed in parallel 85 # for PR, only selective tests are run. 86 # More comprehensive suites are scheduled to run in master 87 tag: 88 - 'basic || basic-raft || (advanced && raft) || networks/typical::raft' 89 - 'basic || basic-istanbul || (advanced && istanbul && !block-heights) || networks/typical::istanbul' 90 runs-on: ubuntu-latest 91 steps: 92 - name: 'Download workflow artifact - Docker image' 93 uses: actions/download-artifact@v1 94 with: 95 name: docker-image 96 - name: 'Load Docker image' 97 id: setup 98 run: | 99 tar xfvz docker-image/quorum-pr.tar.gz 100 docker load --input quorum-pr.tar 101 echo "::set-output name=outputDir::${{ runner.temp }}" 102 - name: 'Run acceptance tests' 103 run: | 104 docker run --rm \ 105 --network host \ 106 -v /var/run/docker.sock:/var/run/docker.sock \ 107 -v ${{ steps.setup.outputs.outputDir }}:${{ steps.setup.outputs.outputDir }} \ 108 -e TF_VAR_quorum_docker_image='{ name = "quorumengineering/quorum:pr", local = true }' \ 109 quorumengineering/acctests:latest test \ 110 -Pauto \ 111 -Dauto.outputDir=${{ steps.setup.outputs.outputDir }} \ 112 -Dtags="${{ matrix.tag }}" 113 - name: 'Debug' 114 run: | 115 docker images 116 docker ps -a