Skip to content

Commit

Permalink
Merge branch 'master' into as-ci-skip-draft
Browse files Browse the repository at this point in the history
  • Loading branch information
alvicsam authored Feb 14, 2025
2 parents 84199a5 + 20ffada commit ddd3dc2
Show file tree
Hide file tree
Showing 181 changed files with 7,142 additions and 2,178 deletions.
23 changes: 10 additions & 13 deletions .github/scripts/generate-prdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ def from_pr_number(n, audience, bump, force):
def translate_audience(audience):
aliases = {
'runtime_dev': 'Runtime Dev',
'runtime_user': 'Runtime Operator',
'runtime_user': 'Runtime User',
'node_dev': 'Node Dev',
'node_user': 'Node User',
'node_operator': 'Node Operator',
'todo': 'Todo',
}

if audience in aliases:
to = aliases[audience]
print(f"Translated audience '{audience}' to '{to}'")
audience = to
mapped = [aliases.get(a) for a in audience]
if len(mapped) == 1:
mapped = mapped[0]

return audience
print(f"Translated audience '{audience}' to '{mapped}'")
return mapped

def create_prdoc(pr, audience, title, description, patch, bump, force):
path = f"prdoc/pr_{pr}.prdoc"
Expand Down Expand Up @@ -128,7 +129,7 @@ def yaml_multiline_string_presenter(dumper, data):
# parse_args is also used by cmd/cmd.py
# if pr_required is False, then --pr is optional, as it can be derived from the PR comment body
def setup_parser(parser=None, pr_required=True):
allowed_audiences = ["runtime_dev", "runtime_user", "node_dev", "node_operator"]
allowed_audiences = ["runtime_dev", "runtime_user", "node_dev", "node_operator", "todo"]
if parser is None:
parser = argparse.ArgumentParser()
parser.add_argument("--pr", type=int, required=pr_required, help="The PR number to generate the PrDoc for.")
Expand All @@ -144,11 +145,7 @@ def main(args):
print(f"Args: {args}, force: {args.force}")
setup_yaml()
try:
# Convert snake_case audience arguments to title case
mapped_audiences = [snake_to_title(a) for a in args.audience]
if len(mapped_audiences) == 1:
mapped_audiences = mapped_audiences[0]
from_pr_number(args.pr, mapped_audiences, args.bump, args.force)
from_pr_number(args.pr, args.audience, args.bump, args.force)
return 0
except Exception as e:
print(f"Error generating prdoc: {e}")
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/build-publish-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# tldr: we need to checkout the branch HEAD explicitly because of our dynamic versioning approach while building the substrate binary
# see https://github.com/paritytech/ci_cd/issues/682#issuecomment-1340953589
ref: ${{ github.head_ref || github.ref_name }}
- name: build
run: |
mkdir -p ./artifacts/substrate/
Expand Down
104 changes: 104 additions & 0 deletions .github/workflows/tests-evm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: EVM test suite

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
preflight:
uses: ./.github/workflows/reusable-preflight.yml

evm-test-suite:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-C debug-assertions"
RUST_BACKTRACE: 1
steps:
- name: Checkout
uses: actions/checkout@v4

- name: script
run: |
forklift cargo build --locked --profile production -p pallet-revive-eth-rpc --bin eth-rpc
forklift cargo build --bin substrate-node
- name: Checkout evm-tests
uses: actions/checkout@v4
with:
repository: paritytech/evm-test-suite
ref: 7762a35a380023a800d213b8ff98f3fb45500661
path: evm-test-suite

- uses: actions/setup-node@v4
with:
node-version: 22

- name: script
env:
# EVM tests don't work with batchSize 300 on self-hosted runners in docker container
BATCH_SIZE: 100
run: |
echo "Change to the evm-test-suite directory"
cd evm-test-suite
echo "Download the resolc binary"
wget https://github.com/paritytech/revive/releases/download/v0.1.0-dev.9/resolc -q
chmod +x resolc
mv resolc /usr/local/bin
resolc --version
echo "Check that binaries are in place"
export NODE_BIN_PATH=$(readlink -f ../target/debug/substrate-node)
export ETH_RPC_PATH=$(readlink -f ../target/production/eth-rpc)
export RESOLC_PATH=/usr/local/bin/resolc
echo $NODE_BIN_PATH $ETH_RPC_PATH $RESOLC_PATH
echo "Install npm dependencies"
npm install
# cat matter-labs-tests/hardhat.config.ts | grep batchSize
echo "Installing solc"
wget https://github.com/ethereum/solidity/releases/download/v0.8.28/solc-static-linux -q
chmod +x solc-static-linux
mv solc-static-linux /usr/local/bin/solc
echo "Run the tests"
echo "bash init.sh --kitchensink -- --matter-labs -- $NODE_BIN_PATH $ETH_RPC_PATH $RESOLC_PATH"
bash init.sh --kitchensink -- --matter-labs -- $NODE_BIN_PATH $ETH_RPC_PATH $RESOLC_PATH
- name: Collect tests results
if: always()
uses: actions/upload-artifact@v4
with:
name: evm-test-suite-${{ github.sha }}
path: evm-test-suite/test-logs/matter-labs-tests.log

confirm-required-test-evm-jobs-passed:
runs-on: ubuntu-latest
name: All test misc tests passed
# If any new job gets added, be sure to add it to this array
needs:
- evm-test-suite
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
21 changes: 20 additions & 1 deletion .github/workflows/zombienet-reusable-preflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ on:
SOURCE_REF_SLUG:
value: ${{ jobs.preflight.outputs.SOURCE_REF_SLUG }}

BUILD_RUN_ID:
value: ${{ jobs.wait_build_images.outputs.BUILD_RUN_ID }}
description: |
Id of the build run, needed to download the artifacts.
# Zombie vars
PUSHGATEWAY_URL:
value: ${{ jobs.preflight.outputs.PUSHGATEWAY_URL }}
Expand Down Expand Up @@ -216,10 +221,13 @@ jobs:
needs: [ci-env]
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
BUILD_RUN_ID: ${{ steps.wait_build.outputs.BUILD_RUN_ID }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Wait until "Build and push images" workflow is done
id: wait_build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -239,4 +247,15 @@ jobs:
fi
sleep 10
done
echo "CI workflow is done."
#check if the build succeeded
RUN_INFO=($(gh run ls -c $SHA -w "Build and push images" --json name,conclusion,databaseId --jq '.[] | select(.name == "Build and push images") | .conclusion, .databaseId'))
CONCLUSION=${RUN_INFO[@]:0:1}
BUILD_RUN_ID=${RUN_INFO[@]:1:1}
if [[ $CONCLUSION == "success" ]]; then
echo "CI workflow succeeded. (build run_id: ${BUILD_RUN_ID})"
echo "BUILD_RUN_ID=${BUILD_RUN_ID}" >> $GITHUB_OUTPUT
else
echo "::warning:: CI workflow ('Build and push images') fails with conclusion: $CONCLUSION"
exit 1
fi;
Loading

0 comments on commit ddd3dc2

Please sign in to comment.