[TEST] print output dir contents #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Check | |
on: | |
push: | |
branches: | |
- master | |
- test | |
env: | |
GO_VERSION: 1.21.3 | |
GOPATH: ${{ github.workspace }}/go | |
WORKING_DIR: ${{ github.workspace }}/go/src/github.com/ethereum/go-ethereum | |
jobs: | |
docker-build: | |
name: 'Build Docker image' | |
runs-on: ubuntu-20.04 | |
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-basic: | |
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: | |
- 'privacy-enhancements-upgrade || networks/template::istanbul-4nodes-pe' | |
- 'mps-mixed-network-psr-check || networks/template::raft-4nodes-mps-mixed' | |
runs-on: ubuntu-20.04 | |
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 | |
docker_env_file="${{ runner.temp }}/env.list" | |
echo "TF_VAR_quorum_docker_image={ name = \"quorumengineering/quorum:pr\", local = true }" >> $docker_env_file | |
echo "::set-output name=outputDir::${{ runner.temp }}" | |
echo "::set-output name=dockerEnvFile::$docker_env_file" | |
- name: 'Run acceptance tests' | |
run: | | |
echo ${{ steps.setup.outputs.dockerEnvFile }} | |
cat ${{ steps.setup.outputs.dockerEnvFile }} | |
echo "docker run..." | |
docker run --rm \ | |
--network host \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v ${{ steps.setup.outputs.outputDir }}:${{ steps.setup.outputs.outputDir }} \ | |
--env-file ${{ steps.setup.outputs.dockerEnvFile }} \ | |
quorumengineering/acctests:latest test \ | |
-Pauto \ | |
-Dauto.outputDir=${{ steps.setup.outputs.outputDir }} \ | |
-Dtags="${{ matrix.tag }}" | |
- name: 'Debug' | |
if: always() | |
run: | | |
sudo apt-get install tree | |
echo "tree ${{ steps.setup.outputs.outputDir }}" | |
tree ${{ steps.setup.outputs.outputDir }} | |
echo "docker images" | |
docker images | |
echo "docker ps -a" | |
docker ps -a | |
echo "LOG DUMP" | |
containers=$(sudo docker ps -a | awk '{if(NR>1) print $NF}') | |
host=$(hostname) | |
# loop through all containers | |
for container in $containers | |
do | |
echo "Container: $container" | |
echo "docker logs $container" | |
docker logs $container | |
echo ================================ | |
done | |