Add genesis sync test to CI (#7561)

* #7550

Use existing code from  @jimmygchen in #7530 and modify for genesis sync test. Thanks @jimmygchen !
This commit is contained in:
chonghe
2025-06-11 17:51:37 +08:00
committed by GitHub
parent 8c6abc0b69
commit 7416d06dce
5 changed files with 241 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ jobs:
- name: Build Docker image
run: |
docker build --build-arg FEATURES=portable -t lighthouse:local .
docker build --build-arg FEATURES=portable,spec-minimal -t lighthouse:local .
docker save lighthouse:local -o lighthouse-docker.tar
- name: Upload Docker image artifact
@@ -213,6 +213,49 @@ jobs:
scripts/local_testnet/logs
retention-days: 3
# Test syncing from genesis on a local testnet. Aims to cover forward syncing both short and long distances.
genesis-sync-test:
name: genesis-sync-test-${{ matrix.fork }}-${{ matrix.offline_secs }}s
runs-on: ubuntu-latest
needs: dockerfile-ubuntu
if: contains(github.event.pull_request.labels.*.name, 'syncing')
strategy:
matrix:
fork: [electra, fulu]
offline_secs: [120, 300]
steps:
- uses: actions/checkout@v4
- name: Install Kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install -y kurtosis-cli
kurtosis analytics disable
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: lighthouse-docker
path: .
- name: Load Docker image
run: docker load -i lighthouse-docker.tar
- name: Run the genesis sync test script
run: |
./genesis-sync.sh "sync-${{ matrix.fork }}-${{ matrix.offline_secs }}s" "genesis-sync-config-${{ matrix.fork }}.yaml" "${{ matrix.fork }}" "${{ matrix.offline_secs }}"
working-directory: scripts/tests
- name: Upload logs artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: logs-genesis-sync-${{ matrix.fork }}-${{ matrix.offline_secs }}s
path: |
scripts/local_testnet/logs
retention-days: 3
# This job succeeds ONLY IF all others succeed. It is used by the merge queue to determine whether
# a PR is safe to merge. New jobs should be added here.
local-testnet-success:
@@ -228,5 +271,5 @@ jobs:
- uses: actions/checkout@v4
- name: Check that success job is dependent on all others
run: |
exclude_jobs='checkpoint-sync-test'
exclude_jobs='checkpoint-sync-test|genesis-sync-test'
./scripts/ci/check-success-job.sh ./.github/workflows/local-testnet.yml local-testnet-success "$exclude_jobs"