2022-11-22 10:12:17 +00:00
|
|
|
name: Hive (Nightly)
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 01 * * *" # run at 1 am UTC every day
|
2022-11-24 02:11:00 +00:00
|
|
|
workflow_dispatch:
|
2022-11-22 10:12:17 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
hive:
|
2022-11-23 15:02:53 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: AutoModality/action-clean@v1
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0 # fetch git tags for "git describe"
|
2022-11-22 10:12:17 +00:00
|
|
|
|
2022-11-23 15:02:53 +00:00
|
|
|
- name: build erigon image
|
|
|
|
run: DOCKER_TAG=thorax/erigon:ci-$GITHUB_SHA DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker
|
2022-11-22 10:12:17 +00:00
|
|
|
|
2022-11-23 15:02:53 +00:00
|
|
|
# check with root permissions, should be cached from previous build
|
|
|
|
- name: build erigon image (root permissions)
|
|
|
|
run: sudo DOCKER_TAG=thorax/erigon:ci-$GITHUB_SHA DOCKER_UID=$(id -u) DOCKER_GID=$(id -g) make docker
|
2022-11-22 10:12:17 +00:00
|
|
|
|
2022-11-23 15:02:53 +00:00
|
|
|
- name: run hive and parse output
|
|
|
|
run: |
|
2022-11-22 10:12:17 +00:00
|
|
|
sudo mkdir -p /results-${{ github.run_id }}
|
|
|
|
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${{ github.workspace }}:/work thorax/hive:latest --sim ethereum/engine --results-root=/work/results-${{ github.run_id }} --client erigon_ci-$GITHUB_SHA --exit.fail=false
|
|
|
|
docker run --rm --pull always -v /var/run/docker.sock:/var/run/docker.sock -v ${{ github.workspace }}:/work --entrypoint /app/hivecioutput thorax/hive:latest --resultsdir=/work/results-${{ github.run_id }} --outdir=/work/results-${{ github.run_id }} --exclusionsfile=/work/hive/exclusions.json
|
|
|
|
|
2022-11-23 15:02:53 +00:00
|
|
|
- name: clean up containers
|
|
|
|
if: always()
|
|
|
|
run: |
|
2022-11-22 10:12:17 +00:00
|
|
|
ids=$(docker ps -a -q)
|
|
|
|
for id in $ids
|
|
|
|
do
|
|
|
|
echo "stopping/removing container: $id"
|
|
|
|
docker stop $id && docker rm $id
|
|
|
|
done
|
|
|
|
|
2022-11-23 15:02:53 +00:00
|
|
|
- name: parse hive results
|
|
|
|
uses: phoenix-actions/test-reporting@v10
|
|
|
|
with:
|
|
|
|
name: Tests
|
|
|
|
path: results-${{ github.run_id }}/*.xml
|
|
|
|
reporter: java-junit
|
2022-11-22 10:12:17 +00:00
|
|
|
|
2022-11-23 15:02:53 +00:00
|
|
|
- name: set badge color
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
case ${{ fromJSON( steps.test-results.outputs.json ).conclusion }} in
|
2022-11-22 10:12:17 +00:00
|
|
|
success)
|
|
|
|
echo "BADGE_COLOR=31c653" >> $GITHUB_ENV
|
|
|
|
;;
|
|
|
|
failure)
|
|
|
|
echo "BADGE_COLOR=800000" >> $GITHUB_ENV
|
|
|
|
;;
|
|
|
|
neutral)
|
|
|
|
echo "BADGE_COLOR=696969" >> $GITHUB_ENV
|
|
|
|
;;
|
2022-11-23 15:02:53 +00:00
|
|
|
esac
|
2022-11-22 10:12:17 +00:00
|
|
|
|
2022-11-23 15:02:53 +00:00
|
|
|
- name: create badge
|
|
|
|
uses: emibcn/badge-action@d6f51ff11b5c3382b3b88689ae2d6db22d9737d1
|
|
|
|
with:
|
|
|
|
label: Hive
|
|
|
|
status: '${{ fromJSON( steps.test-results.outputs.json ).formatted.stats.tests }} tests, ${{ fromJSON( steps.test-results.outputs.json ).formatted.stats.runs }} runs: ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}'
|
|
|
|
color: ${{ env.BADGE_COLOR }}
|
|
|
|
path: badge.svg
|
2022-11-22 10:12:17 +00:00
|
|
|
|
2022-11-23 15:02:53 +00:00
|
|
|
- name: upload badge to gist
|
|
|
|
if: >
|
|
|
|
github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'devel' ||
|
|
|
|
github.event_name != 'workflow_run' && github.ref == 'refs/heads/devel'
|
|
|
|
uses: andymckay/append-gist-action@1fbfbbce708a39bd45846f0955ed5521f2099c6d
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GIST_TOKEN }}
|
|
|
|
gistURL: https://gist.githubusercontent.com/revitteth/dc492845ba6eb694e6c7279224634b20
|
|
|
|
file: badge.svg
|