Kurtosis Assertoor GitHub Action #151
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: Kurtosis Assertoor GitHub Action | |
env: | |
DOCKERHUB_REPOSITORY: "erigontech/erigon" | |
on: | |
workflow_run: | |
workflows: ["CI-CD build and deploy docker images based on the last commit in the main branch"] | |
types: | |
- completed | |
# schedule: | |
# - cron: "0 2,14 * * *" # runs at 2am and 2pm UTC | |
# workflow_dispatch: | |
# pull_request: | |
# branches: | |
# - kurtosis_ci_fix | |
# types: | |
# - opened | |
# - reopened | |
# - synchronize | |
# - ready_for_review | |
# push: | |
# branches: | |
# - main | |
jobs: | |
define_matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
os: ${{ steps.os.outputs.os }} | |
steps: | |
- name: Define os | |
id: os | |
run: echo 'os=["ubuntu-latest"]' >> "$GITHUB_OUTPUT" | |
assertoor_test: | |
needs: define_matrix | |
strategy: | |
matrix: | |
# list of os: https://github.com/actions/virtual-environments | |
os: | |
- ${{ fromJSON(needs.define_matrix.outputs.os) }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: check failure of docker build workflow | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
run: exit 1 | |
- uses: actions/checkout@v4 | |
- name: Get commit id | |
id: getCommitId | |
run: | | |
cd erigon | |
echo "id=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
echo "short_commit_id=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT | |
cd .. | |
- name: Install dependencies on Linux | |
if: runner.os == 'Linux' | |
run: sudo apt update && sudo apt install build-essential | |
- name: download kurtosis config | |
env: | |
BUILD_VERSION: "main-${{ steps.getCommitId.outputs.short_commit_id }}" | |
DOCKER_URL: ${{ env.DOCKERHUB_REPOSITORY }} | |
run: | | |
wget -O kurtosis_config_with_p.yaml https://raw.githubusercontent.com/erigontech/erigon/main/.github/workflows/kurtosis/config.yaml | |
sed 's/<<ERIGON_IMAGE_PLACEHOLDER>>/${{ env.DOCKER_URL }}:${{ env.BUILD_VERSION }}' kurtosis_config_with_p.yaml > kurtosis_config.yaml | |
- name: Run Kurtosis + assertoor tests | |
uses: ethpandaops/kurtosis-assertoor-github-action@v1 | |
with: | |
enclave_name: "kurtosis-run-${{ matrix.os.name }}-${{ github.run_id }}" | |
ethereum_package_args: "./kurtosis_config.yaml" | |
#kurtosis_extra_args: --verbosity detailed --cli-log-level trace | |
enclave_dump: false | |
dnotifications: | |
name: Discord notification | |
needs: | |
- define_matrix | |
- assertoor_test | |
if: ${{ always() }} | |
strategy: | |
matrix: | |
# list of os: https://github.com/actions/virtual-environments | |
os: | |
- ${{ fromJSON(needs.define_matrix.outputs.os) }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: discord notifications push | |
uses: nobrayner/discord-webhook@v1 | |
with: | |
github-token: ${{ secrets.github_token }} | |
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }} |