This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 854
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description This PR introduces testool nightly builds in GH Actions. The workflow can also be triggered manually selecting between light and nightly suites. The reports are public now under: http://testool-public.s3-website.eu-central-1.amazonaws.com/ ### Issue Link #1505 ### Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ### How Has This Been Tested? Executed manually and automatically the workflow, triggering both suites. --------- Co-authored-by: Chih Cheng Liang <[email protected]>
- Loading branch information
1 parent
b7c8a06
commit 6e69b9a
Showing
7 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
export PATH=/home/ubuntu/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/snap/bin:/usr/local/go/bin/ | ||
|
||
error() { | ||
sudo poweroff | ||
} | ||
|
||
trap 'error' ERR | ||
|
||
cd zkevm-circuits/testool | ||
git submodule update --init --recursive ; git submodule update --checkout ; cargo build --release | ||
|
||
exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
profile="cirunner" | ||
runner_vpc_id="vpc-05dedcb650bd24f8d" | ||
|
||
# Get runner status | ||
runner=$(aws ec2 describe-instances --profile $profile --filters Name=tag:Name,Values=[testool] Name=network-interface.vpc-id,Values=[$runner_vpc_id] --query "Reservations[*].Instances[*][InstanceId]" --output text | xargs) | ||
|
||
echo "Reports: http://testool-public.s3-website.eu-central-1.amazonaws.com" | ||
echo "Shuting down instance..." | ||
aws ec2 stop-instances --profile $profile --instance-ids $runner | ||
|
||
exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
error() { | ||
sudo poweroff | ||
} | ||
|
||
trap 'error' ERR | ||
|
||
branch=$1 | ||
|
||
rm -rf zkevm-circuits | ||
git clone https://github.com/privacy-scaling-explorations/zkevm-circuits.git | ||
cd zkevm-circuits/testool | ||
git checkout $branch | ||
ln -s /home/ubuntu/report report | ||
|
||
exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
export PATH=/home/ubuntu/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/snap/bin:/usr/local/go/bin/ | ||
|
||
error() { | ||
sudo poweroff | ||
} | ||
|
||
trap 'error' ERR | ||
|
||
suite=$1 | ||
|
||
cd zkevm-circuits/testool | ||
../target/release/testool --suite $suite --report | ||
|
||
exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
error() { | ||
sudo poweroff | ||
} | ||
|
||
trap 'error' ERR | ||
|
||
cd report | ||
rm index.html | ||
for i in `ls -t *.html`; do echo "<a href=\"$i\">$i</a> <br>" >> index.html; done | ||
|
||
aws s3 sync . s3://testool-public/ | ||
|
||
exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
profile="cirunner" | ||
runner_vpc_id="vpc-05dedcb650bd24f8d" | ||
|
||
# Get runner status | ||
runner=$(aws ec2 describe-instances --profile $profile --filters Name=tag:Name,Values=[testool] Name=network-interface.vpc-id,Values=[$runner_vpc_id] --query "Reservations[*].Instances[*][InstanceId]" --output text | xargs) | ||
|
||
while true; do | ||
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner --query "Reservations[*].Instances[*].State.[Name]" --output text) | ||
if [ $runner_status = "stopped" ]; then | ||
aws ec2 start-instances --profile $profile --instance-ids $runner | ||
exit 0 | ||
elif [ $runner_status = "running" ]; then | ||
sleep 120 | ||
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner --query "Reservations[*].Instances[*].State.[Name]" --output text) | ||
if [ $runner_status = "running" ]; then | ||
exit 0 | ||
fi | ||
else | ||
sleep 30 | ||
fi | ||
done |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Testool | ||
|
||
on: | ||
schedule: | ||
- cron: '30 23 * * *' | ||
workflow_dispatch: | ||
inputs: | ||
suites: | ||
description: "Suites" | ||
required: true | ||
default: "light" | ||
type: choice | ||
options: | ||
- light | ||
- nightly | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
testool: | ||
if: github.event.pull_request.draft == false | ||
|
||
name: Testool | ||
runs-on: [pse-runner] | ||
env: | ||
DATA: ${{ github.event.inputs.suites || 'nightly' }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Wakeup testool | ||
run: .github/testoolScripts/wakeUpRunner.sh | ||
|
||
- name: Prepare repo | ||
run: ssh testool "bash -s" -- < .github/testoolScripts/prepare.sh "$GITHUB_REF_NAME" | ||
|
||
- name: Cargo build | ||
run: ssh testool "bash -s" -- < .github/testoolScripts/build.sh | ||
|
||
- name: Run tests | ||
run: ssh testool "bash -s" -- < .github/testoolScripts/run.sh ${{ env.DATA }} | ||
|
||
- name: Sync reports | ||
run: ssh testool "bash -s" -- < .github/testoolScripts/sync.sh | ||
|
||
- name: Cleanup | ||
run: .github/testoolScripts/cleanup.sh | ||
|