Skip to content

Commit e483c23

Browse files
Update nightly.yml
name: Nightly on: schedule: - cron: '0 6 * * *' # Run this workflow every day at 6 AM Paris time (UTC+2). workflow_dispatch: inputs: param_file: description: This parameter file will be used when running Antithesis tests required: false type: string default: .github/tests/antithesis/fork12-cdk-erigon-validium.yml concurrency: group: nightly-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: ENCLAVE_NAME: cdk # Antithesis parameters. ANTITHESIS_REGISTRY: us-central1-docker.pkg.dev ANTITHESIS_REPOSITORY: molten-verve-216720/polygon-repository ANTITHESIS_TENANT: polygon ANTITHESIS_NOTEBOOK: polygon # This parameter file will be used when running Antithesis tests using the nightly schedule. DEFAULT_ANTITHESIS_PARAM_FILE: .github/tests/antithesis/fork12-cdk-erigon-validium.yml jobs: list-ymls: runs-on: ubuntu-latest timeout-minutes: 5 outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - uses: actions/checkout@v4 - name: Generate test combinations working-directory: .github/tests run: ./combine-ymls.sh - id: set-matrix run: | files=$(ls -R ./.github/tests/combinations/*.yml ./.github/tests/nightly/**/*.yml | grep -Ev "sovereign|anvil|gas-token|pless-zkevm-node") matrix=$(echo "$files" | jq -R -s -c 'split("\n")[:-1]') echo "matrix=$matrix" >> $GITHUB_OUTPUT run-with-args: needs: list-ymls runs-on: ubuntu-latest timeout-minutes: 30 strategy: fail-fast: false matrix: file_name: ${{ fromJson(needs.list-ymls.outputs.matrix) }} steps: - uses: actions/checkout@v4 - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} if: ${{ env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN }} env: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - name: Install Kurtosis CDK tools uses: ./.github/actions/setup-kurtosis-cdk - name: Generate test combinations working-directory: .github/tests run: ./combine-ymls.sh - name: Create Enclave run: kurtosis enclave create ${{ env.ENCLAVE_NAME }} - name: Run Starlark run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=${{ matrix.file_name }} --show-enclave-inspect=false . - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} - name: Verify static ports run: | if [[ ${{ matrix.file_name }} == "./.github/tests/static-ports/default-static-ports.yml" ]]; then echo "Making sure public ports start by a 5 as defined by the static ports in the input_parser.star file." ports=$(kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} | sed -n '/^========================================== User Services ==========================================$/,$ p' | tail -n +3) if ! wrong_ports=$(echo "$ports" | grep -vE '127.0.0.1:5|none'); then echo "✅ Default static ports are set correctly." exit 0 else echo "wrong_ports: $wrong_ports" echo "❌ Default static ports are not set correctly." exit 1 fi else echo "Skipping." fi - name: Monitor CDK chain verified batches (Central RPC) run: | result=$(yq --raw-output '.args.consensus_contract_type' ${{ matrix.file_name }}) if [[ "$result" == "pessimistic" ]]; then echo "Skipping block verification as consensus is pessimistic." else sequencer_type=$(yq --raw-output '.args.sequencer_type' ${{ matrix.file_name }}) rpc_name="" if [[ "$sequencer_type" == "erigon" ]]; then rpc_name="cdk-erigon-rpc-001" elif [[ "$sequencer_type" == "zkevm" ]]; then rpc_name="zkevm-node-rpc-001" elif [[ "$sequencer_type" == "null" ]]; then rpc_name="cdk-erigon-rpc-001" else echo "Unknown sequencer type: $sequencer_type" exit 1 fi echo "RPC name: $rpc_name" ./.github/scripts/monitor-cdk-chain.sh \ --enclave ${{ env.ENCLAVE_NAME }} \ --rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} $rpc_name rpc) fi - name: Monitor CDK chain verified batches (zkEVM Permissionless RPC) run: | result=$(yq --raw-output '.args.consensus_contract_type' ${{ matrix.file_name }}) if [[ "$result" == "pessimistic" ]]; then echo "Skipping block verification as consensus is pessimistic." else result=$(yq --raw-output '.args.additional_services // [] | contains(["pless_zkevm_node"])' ${{ matrix.file_name }}) if [[ "$result" == "true" ]]; then ./.github/scripts/monitor-cdk-chain.sh \ --enclave ${{ env.ENCLAVE_NAME }} \ --rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} zkevm-node-rpc-pless-001 rpc) else echo "Skipping batch verification as there is no zkevm permissionless RPC in the environment" fi fi - name: Monitor OP rollup finalized blocks (OP CL RPC) run: | result=$(yq --raw-output '.deployment_stages.deploy_optimism_rollup' ${{ matrix.file_name }}) if [[ "$result" == "true" ]]; then ./.github/scripts/monitor-op-rollup.sh \ --enclave ${{ env.ENCLAVE_NAME }} \ --cl-rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} op-cl-1-op-node-op-geth-op-kurtosis http) else echo "Skipping block verification as there is no OP rollup in the environment" - name: Dump enclave if: ${{ !cancelled() }} run: kurtosis enclave dump ${{ env.ENCLAVE_NAME }} ./dump - name: Generate archive name if: ${{ !cancelled() }} run: | file_name=$(basename "${{ matrix.file_name }}" ".yml") archive_name="dump_run_with_args_${file_name}_${{ github.run_id }}" echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV" echo "Generated archive name: ${archive_name}" - name: Upload enclave dump if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: name: ${{ env.ARCHIVE_NAME }} path: ./dump pre-deployed-gas-token: runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: actions/checkout@v4 - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }}
1 parent c6ff801 commit e483c23

1 file changed

Lines changed: 70 additions & 63 deletions

File tree

.github/workflows/nightly.yml

Lines changed: 70 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ jobs:
3232
runs-on: ubuntu-latest
3333
timeout-minutes: 5
3434
outputs:
35-
matrix: <span class="math-inline">\{\{ steps\.set\-matrix\.outputs\.matrix \}\}
36-
steps\:
37-
\- uses\: actions/checkout@v4
38-
\- name\: Generate test combinations
39-
working\-directory\: \.github/tests
40-
run\: \./combine\-ymls\.sh
41-
\- id\: set\-matrix
42-
run\: \|
43-
files\=</span>(ls -R ./.github/tests/combinations/*.yml ./.github/tests/nightly/**/*.yml | grep -Ev "sovereign|anvil|gas-token|pless-zkevm-node")
35+
matrix: ${{ steps.set-matrix.outputs.matrix }}
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Generate test combinations
40+
working-directory: .github/tests
41+
run: ./combine-ymls.sh
42+
43+
- id: set-matrix
44+
run: |
45+
files=$(ls -R ./.github/tests/combinations/*.yml ./.github/tests/nightly/**/*.yml | grep -Ev "sovereign|anvil|gas-token|pless-zkevm-node")
4446
matrix=$(echo "$files" | jq -R -s -c 'split("\n")[:-1]')
4547
echo "matrix=$matrix" >> $GITHUB_OUTPUT
4648
@@ -60,46 +62,51 @@ files\=</span>(ls -R ./.github/tests/combinations/*.yml ./.github/tests/nightly/
6062
with:
6163
username: ${{ secrets.DOCKERHUB_USERNAME }}
6264
password: ${{ secrets.DOCKERHUB_TOKEN }}
63-
# This step will only execute if the necessary secrets are available, preventing failures
64-
# on pull requests from forked repositories.
6565
if: ${{ env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN }}
6666
env:
6767
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
68-
DOCKERHUB_TOKEN: <span class="math-inline">\{\{ secrets\.DOCKERHUB\_TOKEN \}\}
69-
\- name\: Install Kurtosis CDK tools
70-
uses\: \./\.github/actions/setup\-kurtosis\-cdk
71-
\- name\: Generate test combinations
72-
working\-directory\: \.github/tests
73-
run\: \./combine\-ymls\.sh
74-
\- name\: Run Starlark
75-
run\: kurtosis run \-\-enclave\=</span>{{ env.ENCLAVE_NAME }} --args-file=${{ matrix.file_name }} --show-enclave-inspect=false .
68+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
69+
70+
- name: Install Kurtosis CDK tools
71+
uses: ./.github/actions/setup-kurtosis-cdk
72+
73+
- name: Generate test combinations
74+
working-directory: .github/tests
75+
run: ./combine-ymls.sh
76+
77+
- name: Create Enclave
78+
run: kurtosis enclave create ${{ env.ENCLAVE_NAME }}
79+
80+
- name: Run Starlark
81+
run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=${{ matrix.file_name }} --show-enclave-inspect=false .
7682

7783
- name: Inspect enclave
7884
run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }}
7985

8086
- name: Verify static ports
8187
run: |
82-
if [[ <span class="math-inline">\{\{ matrix\.file\_name \}\} \=\= "\./\.github/tests/static\-ports/default\-static\-ports\.yml" \]\]; then
83-
echo "Making sure public ports start by a 5 as defined by the static ports in the input\_parser\.star file\."
84-
ports\=</span>(kurtosis enclave inspect <span class="math-inline">\{\{ env\.ENCLAVE\_NAME \}\} \| sed \-n '/^\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\= User Services \=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=</span>/,$ p' | tail -n +3)
88+
if [[ ${{ matrix.file_name }} == "./.github/tests/static-ports/default-static-ports.yml" ]]; then
89+
echo "Making sure public ports start by a 5 as defined by the static ports in the input_parser.star file."
90+
ports=$(kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} | sed -n '/^========================================== User Services ==========================================$/,$ p' | tail -n +3)
8591
if ! wrong_ports=$(echo "$ports" | grep -vE '127.0.0.1:5|none'); then
8692
echo "✅ Default static ports are set correctly."
8793
exit 0
8894
else
89-
echo "wrong_ports: <span class="math-inline">wrong\_ports"
90-
echo "❌ Default static ports are not set correctly\."
91-
exit 1
92-
fi
93-
else
94-
echo "Skipping\."
95-
fi
96-
\- name\: Monitor CDK chain verified batches \(Central RPC\)
97-
run\: \|
98-
result\=</span>(yq --raw-output '.args.consensus_contract_type' ${{ matrix.file_name }})
99-
if [[ "<span class="math-inline">result" \=\= "pessimistic" \]\]; then
100-
echo "Skipping block verification as consensus is pessimistic\."
101-
else
102-
sequencer\_type\=</span>(yq --raw-output '.args.sequencer_type' ${{ matrix.file_name }})
95+
echo "wrong_ports: $wrong_ports"
96+
echo "❌ Default static ports are not set correctly."
97+
exit 1
98+
fi
99+
else
100+
echo "Skipping."
101+
fi
102+
103+
- name: Monitor CDK chain verified batches (Central RPC)
104+
run: |
105+
result=$(yq --raw-output '.args.consensus_contract_type' ${{ matrix.file_name }})
106+
if [[ "$result" == "pessimistic" ]]; then
107+
echo "Skipping block verification as consensus is pessimistic."
108+
else
109+
sequencer_type=$(yq --raw-output '.args.sequencer_type' ${{ matrix.file_name }})
103110
rpc_name=""
104111
if [[ "$sequencer_type" == "erigon" ]]; then
105112
rpc_name="cdk-erigon-rpc-001"
@@ -113,44 +120,45 @@ sequencer\_type\=</span>(yq --raw-output '.args.sequencer_type' ${{ matrix.file_
113120
fi
114121
echo "RPC name: $rpc_name"
115122
./.github/scripts/monitor-cdk-chain.sh \
116-
--enclave <span class="math-inline">\{\{ env\.ENCLAVE\_NAME \}\} \\
117-
\-\-rpc\-url "</span>(kurtosis port print ${{ env.ENCLAVE_NAME }} <span class="math-inline">rpc\_name rpc\)"
118-
fi
119-
\- name\: Monitor CDK chain verified batches \(zkEVM Permissionless RPC\)
120-
run\: \|
121-
result\=</span>(yq --raw-output '.args.consensus_contract_type' ${{ matrix.file_name }})
122-
if [[ "<span class="math-inline">result" \=\= "pessimistic" \]\]; then
123-
echo "Skipping block verification as consensus is pessimistic\."
124-
else
125-
result\=</span>(yq --raw-output '.args.additional_services // [] | contains(["pless_zkevm_node"])' ${{ matrix.file_name }})
123+
--enclave ${{ env.ENCLAVE_NAME }} \
124+
--rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} $rpc_name rpc)
125+
fi
126+
127+
- name: Monitor CDK chain verified batches (zkEVM Permissionless RPC)
128+
run: |
129+
result=$(yq --raw-output '.args.consensus_contract_type' ${{ matrix.file_name }})
130+
if [[ "$result" == "pessimistic" ]]; then
131+
echo "Skipping block verification as consensus is pessimistic."
132+
else
133+
result=$(yq --raw-output '.args.additional_services // [] | contains(["pless_zkevm_node"])' ${{ matrix.file_name }})
126134
if [[ "$result" == "true" ]]; then
127135
./.github/scripts/monitor-cdk-chain.sh \
128-
--enclave <span class="math-inline">\{\{ env\.ENCLAVE\_NAME \}\} \\
129-
\-\-rpc\-url "</span>(kurtosis port print <span class="math-inline">\{\{ env\.ENCLAVE\_NAME \}\} zkevm\-node\-rpc\-pless\-001 rpc\)"
130-
else
131-
echo "Skipping batch verification as there is no zkevm permissionless RPC in the environment"
132-
fi
133-
fi
134-
\- name\: Monitor OP rollup finalized blocks \(OP CL RPC\)
135-
run\: \|
136-
result\=</span>(yq --raw-output '.deployment_stages.deploy_optimism_rollup' ${{ matrix.file_name }})
136+
--enclave ${{ env.ENCLAVE_NAME }} \
137+
--rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} zkevm-node-rpc-pless-001 rpc)
138+
else
139+
echo "Skipping batch verification as there is no zkevm permissionless RPC in the environment"
140+
fi
141+
fi
142+
143+
- name: Monitor OP rollup finalized blocks (OP CL RPC)
144+
run: |
145+
result=$(yq --raw-output '.deployment_stages.deploy_optimism_rollup' ${{ matrix.file_name }})
137146
if [[ "$result" == "true" ]]; then
138147
./.github/scripts/monitor-op-rollup.sh \
139-
--enclave <span class="math-inline">\{\{ env\.ENCLAVE\_NAME \}\} \\
140-
\-\-cl\-rpc\-url "</span>(kurtosis port print ${{ env.ENCLAVE_NAME }} op-cl-1-op-node-op-geth-op-kurtosis http)"
148+
--enclave ${{ env.ENCLAVE_NAME }} \
149+
--cl-rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} op-cl-1-op-node-op-geth-op-kurtosis http)
141150
else
142151
echo "Skipping block verification as there is no OP rollup in the environment"
143-
fi
144152
145153
- name: Dump enclave
146154
if: ${{ !cancelled() }}
147155
run: kurtosis enclave dump ${{ env.ENCLAVE_NAME }} ./dump
148156

149157
- name: Generate archive name
150-
if: <span class="math-inline">\{\{ \!cancelled\(\) \}\}
151-
run\: \|
152-
file\_name\=</span>(basename "<span class="math-inline">\{\{ matrix\.file\_name \}\}" "\.yml"\)
153-
archive\_name\="dump\_run\_with\_args\_</span>{file_name}_${{ github.run_id }}"
158+
if: ${{ !cancelled() }}
159+
run: |
160+
file_name=$(basename "${{ matrix.file_name }}" ".yml")
161+
archive_name="dump_run_with_args_${file_name}_${{ github.run_id }}"
154162
echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV"
155163
echo "Generated archive name: ${archive_name}"
156164
@@ -172,4 +180,3 @@ archive\_name\="dump\_run\_with\_args\_</span>{file_name}_${{ github.run_id }}"
172180
with:
173181
username: ${{ secrets.DOCKERHUB_USERNAME }}
174182
password: ${{ secrets.DOCKERHUB_TOKEN }}
175-
#

0 commit comments

Comments
 (0)