-
Notifications
You must be signed in to change notification settings - Fork 459
121 lines (105 loc) · 4.02 KB
/
test-assertoor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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" ]]; 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