Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Hive CI output parse (erigontech#4737)
Browse files Browse the repository at this point in the history
* feat(ci): run hive tests as part of CI

* feat(ci): add hive test runs and output parse

* feat(ci): parse hive output for forked repos
  • Loading branch information
revitteth committed Jul 21, 2022
1 parent 1becfc5 commit 770d7cf
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,21 @@ jobs:
fetch-depth: 0 # fetch git tags for "git describe"

- name: make docker
run: DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker
run: DOCKER_TAG=thorax/erigon:ci-$GITHUB_SHA DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker

# check with root permissions, should be cached from previous build
- name: sudo make docker
run: sudo DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker
run: sudo DOCKER_TAG=thorax/erigon:ci-$GITHUB_SHA DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker

- name: run hive
run: sudo mkdir /results && docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${{ github.workspace }}:/work gatewayfm/hive:latest --sim ethereum/sync --results-root=/work/results --client erigon_ci-$GITHUB_SHA --docker.output --loglevel 5

- name: parse hive output
run: docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${{ github.workspace }}:/work --entrypoint /app/hivecioutput gatewayfm/hive:latest --resultsdir=/work/results --outdir=/work/results

- name: archive hive results
uses: actions/upload-artifact@v3
if: always()
with:
name: hive-ci-output
path: results/*.xml
37 changes: 37 additions & 0 deletions .github/workflows/hive-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Hive results

on:
workflow_run:
workflows: ["Continuous integration", "ci"]
types:
- completed

jobs:
hive-results:
name: Hive results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'

steps:
- name: Download and extract artifacts
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
mkdir -p artifacts && cd artifacts
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
do
IFS=$'\t' read name url <<< "$artifact"
gh api $url > "$name.zip"
unzip -d "$name" "$name.zip"
done
- name: Publish hive test results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.xml"

0 comments on commit 770d7cf

Please sign in to comment.