Update README.md #3
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
name: CI Workflow | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
build-and-test: | |
runs-on: [self-hosted, gpu] | |
services: | |
docker: | |
image: docker:20.10.7 | |
options: --privileged | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
path: ${{ github.workspace }}/${{ github.run_id }} | |
- name: Pull submodules | |
run: | | |
cd ${{ github.workspace }}/${{ github.run_id }} | |
git submodule update --init --recursive | |
- name: Cache Docker images. | |
uses: ScribeMD/[email protected] | |
with: | |
key: docker-${{ runner.os }}-${{ hashFiles('.devcontainer/devcontainer.json') }} | |
- name: Pull cached Docker image | |
run: | | |
cd ${{ github.workspace }}/${{ github.run_id }} | |
docker pull augustus/goevmlab-cuevm:20241008 || true | |
- name: Start cuevm-test-runner container | |
run: | | |
cd ${{ github.workspace }}/${{ github.run_id }} | |
docker run --gpus all --memory="3g" --memory-swap="3g" -d --name cuevm-test-runner-${{ github.run_id }} \ | |
-v ${{ github.workspace }}/${{ github.run_id }}:/workspaces/CuEVM \ | |
-w /workspaces/CuEVM \ | |
augustus/goevmlab-cuevm:gpu /bin/bash -c "tail -f /dev/null" | |
- name: Build binary inside the container | |
run: | | |
cd ${{ github.workspace }}/${{ github.run_id }} | |
docker exec cuevm-test-runner-${{ github.run_id }} /bin/bash -c " | |
cmake -S . -B build -DTESTS=OFF -DGPU=ON -DCPU=OFF -DCUDA_COMPUTE_CAPABILITY=86 -DENABLE_EIP_3155_OPTIONAL=OFF -DENABLE_EIP_3155=ON | |
cmake --build build -j 8 | |
" | |
- name: Clone ethereum/tests | |
run: | | |
cd ${{ github.workspace }}/${{ github.run_id }} | |
git clone --depth=1 --branch shanghai https://github.com/ethereum/tests.git ${{ github.workspace }}/${{ github.run_id }}/ethereum/tests | |
# echo "Disabling vmPerformance test" | |
# rm -rf ${{ github.workspace }}/${{ github.run_id }}/ethereum/tests/GeneralStateTests/VMTests/vmPerformance | |
- name: Run tests concurrently using Python | |
run: | | |
cd ${{ github.workspace }}/${{ github.run_id }} | |
python3 -u scripts/run-ci-tests-gpu.py | |
- name: Generate summary of test results in markdown | |
run: | | |
cd ${{ github.workspace }}/${{ github.run_id }} | |
python3 scripts/generate-ci-test-summary.py | |
- name: Send summary to Slack | |
run: | | |
summary_content=$(cat ${{ github.workspace }}/${{ github.run_id }}/test-outputs/summary.md) | |
job_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
curl -X POST -H 'Content-type: application/json' \ | |
--data "{\"text\": \"*Test Summary*\n\n\`\`\`$summary_content\`\`\`\n\n*Job Summary*\n- Workflow: ${{ github.workflow }}\n- Job: ${{ github.job }}\n- Repository: ${{ github.repository }}\n- Commit SHA: ${{ github.sha }}\n- Branch: ${{ github.head_ref }}\n- Run ID: ${{ github.run_id }}\n- Run URL: $job_url\"}" \ | |
${{ secrets.SLACK_WEBHOOK_URL }} | |
- name: Archive test results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-results | |
path: ${{ github.workspace }}/${{ github.run_id }}/test-outputs | |
- name: Clean up | |
if: always() | |
run: | | |
docker exec cuevm-test-runner-${{ github.run_id }} rm -rf /workspaces/CuEVM || true | |
rm -rf ${{ github.workspace }}/${{ github.run_id }} || true | |
docker stop cuevm-test-runner-${{ github.run_id }} || true | |
docker kill -s -9 cuevm-test-runner-${{ github.run_id }} || true | |
docker rm -f cuevm-test-runner-${{ github.run_id }} || true |