-
Notifications
You must be signed in to change notification settings - Fork 956
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci/action: add triggerable chain sync
- Loading branch information
1 parent
12255e7
commit 965ed3b
Showing
2 changed files
with
120 additions
and
2 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
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,118 @@ | ||
name: Triggerable chain sync test | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'Branch name' | ||
required: true | ||
type: string | ||
chain_id: | ||
description: 'Chain ID' | ||
required: true | ||
type: string | ||
add_peer: | ||
description: "Optional address to add to Comet's P2P config (must be a valid `TendermintAddress`, e.g. `tcp://[email protected]:26656`)." | ||
required: false | ||
default: '' | ||
type: string | ||
|
||
env: | ||
RUSTC_WRAPPER: sccache | ||
SCCACHE_S3_USE_SSL: ${{ secrets.CACHE_SSL }} | ||
GIT_LFS_SKIP_SMUDGE: 1 | ||
CARGO_INCREMENTAL: 0 | ||
RUST_BACKTRACE: full | ||
SCCACHE_BUCKET: namada-cache | ||
SCCACHE_ENDPOINT: ${{ secrets.CACHE_ENDPOINT }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.CACHE_ACCESS_KEY }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CACHE_SECRET_KEY }} | ||
AWS_REGION: us-east-1 | ||
|
||
jobs: | ||
test-sync: | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: ${{ matrix.timeout }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
mold_version: [2.4.0] | ||
name: ["Run chain sync test"] | ||
nightly_version: [nightly-2023-06-01] | ||
timeout: [360] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- name: Get latest commit SHA | ||
run: | | ||
git fetch origin ${{ inputs.branch }} | ||
echo "COMMIT_SHA=$(git rev-parse origin/${{ inputs.branch }})" >> $GITHUB_ENV | ||
- name: Install libudev | ||
run: sudo apt-get update && sudo apt-get -y install libudev-dev | ||
- name: Install Protoc | ||
uses: heliaxdev/setup-protoc@v2 | ||
with: | ||
version: "25.0" | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
- name: Setup rust toolchain | ||
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36 | ||
with: | ||
toolchain: ${{ matrix.nightly_version }} | ||
profile: default | ||
- name: Cache cargo registry | ||
uses: actions/cache@v3 | ||
continue-on-error: false | ||
with: | ||
path: | | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
key: ${{ runner.os }}-${{ github.job }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: ${{ runner.os }}-cargo- | ||
- name: Start sccache server | ||
run: sccache --start-server | ||
- name: Install mold linker | ||
run: | | ||
wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz | ||
mv mold-${{ matrix.mold_version }}-x86_64-linux/bin/mold /usr/local/bin | ||
- name: Download namada release binaries | ||
run: | | ||
unset AWS_SESSION_TOKEN | ||
aws --endpoint-url $S3_ENDPOINT_URL s3 cp s3://$BUCKET_NAME $ZIP_FILENAME --region $AWS_REGION | ||
unzip $ZIP_FILENAME | ||
env: | ||
BUCKET_NAME: namada-binaries | ||
AWS_REGION: us-east-1 | ||
S3_ENDPOINT_URL: https://minio.heliax.click | ||
ZIP_FILENAME: binaries-$COMMIT_SHA.zip | ||
AWS_ACCESS_KEY_ID: ${{ secrets.MINIO_ACCESS_KEY }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.MINIO_SECRET_KEY }} | ||
- name: Run the test | ||
run: cargo +{{ matrix.nightly_version }} | ||
test e2e::ledger_tests::test_sync_chain -- --exact --ignored | ||
env: | ||
NAMADA_E2E_USE_PREBUILT_BINARIES: "true" | ||
NAMADA_E2E_KEEP_TEMP: "true" | ||
NAMADA_LOG_COLOR: "false" | ||
NAMADA_ADD_PEER: "{{ inputs.add_peer }}" | ||
NAMADA_CHAIN_ID: "{{ inputs.chain_id }}" | ||
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold" | ||
- name: Upload logs | ||
if: success() || failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: logs-sync-$COMMIT_SHA | ||
path: | | ||
/tmp/.*/logs/ | ||
/tmp/.*/setup/validator-*/logs/ | ||
/tmp/.*/setup/valiator-*/e2e-test.*/*.toml | ||
retention-days: 5 | ||
- name: Stats sccache server | ||
run: sccache --show-stats || true | ||
- name: Start sccache server | ||
run: sccache --stop-server || true |