Skip to content

Commit

Permalink
Assertoor (#6935)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilchodola authored Aug 22, 2024
1 parent 248e4ec commit 871b025
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/tests/assertor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
participants_matrix:
el:
- el_type: nethermind
el_image: <DOCKER_IMAGE_PLACEHOLDER>
- el_type: geth
cl:
- cl_type: prysm
- cl_type: lighthouse
- cl_type: teku
- cl_type: lodestar
- cl_type: nimbus
network_params:
preset: "minimal"
additional_services:
- assertoor
<ASSERTOOR_PARAMS_PLACEHOLDER>
123 changes: 123 additions & 0 deletions .github/workflows/test-assertoor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Assertoor tests

on:
workflow_dispatch:
workflow_run:
workflows: ["Publish Docker image"]
branches: [master]
types:
- completed

jobs:
get_tests:
name: "Run assertoor tests on Nethermind pairs"
runs-on: ubuntu-latest
steps:
- name: Authenticate App
id: gh-app
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout this repository
uses: actions/checkout@v4
with:
path: main-repo

- name: Checkout assertoor-test repository
uses: actions/checkout@v4
with:
repository: kamilchodola/assertoor-test
path: assertoor-test

- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.x'

- name: Install dependencies
run: pip install requests beautifulsoup4

- name: Run retriveAllTests.py script
run: |
python assertoor-test/scripts/retriveAllTests/retriveAllTests.py --exclude "pectra-dev" "verkle" "validator-lifecycle" "slashing" "mev" > /tmp/output.txt
cat /tmp/output.txt
chmod 777 /tmp/output.txt
echo "ASSERTOOR_PARAMS_FILE=/tmp/output.txt" >> $GITHUB_ENV
- name: Prepare docker tag
id: prepare_ref
run: |
REF_NAME=${{ inputs.nethermind_repo_ref || github.ref }}
CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g')
echo "CLEAN_REF=$CLEAN_REF" >> $GITHUB_ENV
- name: Set Repo and Org Variables
run: |
echo "ORG_NAME=${{ github.repository_owner }}" >> $GITHUB_ENV
echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV
- name: Check if master branch and default additional_options
id: check_conditions
run: |
ref="${{ github.ref }}"
if [[ $ref != refs/heads/* ]]; then
ref="refs/heads/$ref"
fi
if
[[ "$ref" == "refs/heads/master" ]] &&
[[ "${{ steps.extract_dockerfile.outputs.dockerfile }}" == "Dockerfile" ]] &&
[[ "${{ steps.extract_dockerfile.outputs.build-config }}" == "release" ]]; then
echo "skip_docker_build=true" >> $GITHUB_OUTPUT
else
echo "skip_docker_build=false" >> $GITHUB_OUTPUT
fi
- name: Trigger Docker Build Action with Cleaned Ref
if: steps.check_conditions.outputs.skip_docker_build != 'true'
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-docker.yml
ref: "${{ github.ref }}"
token: "${{ steps.gh-app.outputs.token }}"
inputs: '{
"tag": "${{ env.CLEAN_REF }}",
"dockerfile": "${{ steps.extract_dockerfile.outputs.dockerfile }}",
"build-config": "${{ steps.extract_dockerfile.outputs.build-config }}"
}'

- name: Wait for Docker Build Action to complete
if: steps.check_conditions.outputs.skip_docker_build != 'true'
env:
GITHUB_TOKEN: ${{ steps.gh-app.outputs.token }}
WORKFLOW_ID: 'publish-docker.yml'
MAX_WAIT_MINUTES: "5"
INTERVAL: "5"
TIMEOUT: '20'
ORG_NAME: ${{ env.ORG_NAME }}
REPO_NAME: ${{ env.REPO_NAME }}
REF: ${{ github.ref }}
run: |
chmod +x main-repo/scripts/wait-for-workflow-completed.sh
./main-repo/scripts/wait-for-workflow-completed.sh
working-directory: ${{ github.workspace }}

- name: Replace Placeholders in YAML
run: |
assertoor_params=$(cat ${{ env.ASSERTOOR_PARAMS_FILE}})
sed -i "s|<DOCKER_IMAGE_PLACEHOLDER>|nethermindeth/nethermind:${{ env.CLEAN_REF }}|g" main-repo/.github/tests/assertor.yaml
sed -i "/<ASSERTOOR_PARAMS_PLACEHOLDER>/ {
r /tmp/output.txt
d
}" main-repo/.github/tests/assertor.yaml
cat main-repo/.github/tests/assertor.yaml
- name: Kurtosis Assertoor GitHub Action
uses: ethpandaops/kurtosis-assertoor-github-action@v1
with:
ethereum_package_url: "github.com/ethpandaops/ethereum-package"
ethereum_package_branch: ""
ethereum_package_args: main-repo/.github/tests/assertor.yaml

0 comments on commit 871b025

Please sign in to comment.