AEDA encryption (#171) #575
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: [seismic] | |
| pull_request: | |
| branches: [seismic] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| rustfmt: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rustfmt | |
| - name: Check formatting | |
| run: cargo fmt --all --check | |
| build: | |
| runs-on: self-hosted | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "build-cache" | |
| cache-on-failure: true | |
| - name: cargo build without flags | |
| run: cargo build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: enclave-binaries | |
| path: | | |
| target/debug/seismic-enclave* | |
| target/debug/seismic-enclave-server* | |
| target/debug/enclave-contract* | |
| retention-days: 1 | |
| warnings: | |
| runs-on: self-hosted | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "warnings-cache" | |
| - name: cargo check warnings | |
| run: RUSTFLAGS="-D warnings" cargo check | |
| test_enclave: | |
| runs-on: self-hosted | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "client-cache" | |
| - name: Run tests for seismic-enclave | |
| run: | | |
| cd crates/enclave | |
| OUTPUT=$(cargo test -p seismic-enclave --no-run 2>&1) | |
| echo "$OUTPUT" | |
| mapfile -t binaries < <(echo "$OUTPUT" | grep -o '/[^ ]*seismic_enclave-[a-z0-9]*') | |
| for binary in "${binaries[@]}"; do | |
| echo "Running binary: $binary" | |
| sudo "$binary" | |
| done | |
| test_enclave_server: | |
| runs-on: self-hosted | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "service-cache" | |
| - name: Run tests for seismic-enclave-server | |
| run: | | |
| cd crates/enclave-server | |
| OUTPUT=$(cargo test -p seismic-enclave-server --no-run 2>&1) | |
| echo "$OUTPUT" | |
| mapfile -t binaries < <(echo "$OUTPUT" | grep -o '/[^ ]*seismic_enclave_server-[a-z0-9]*') | |
| for binary in "${binaries[@]}"; do | |
| echo "Running binary: $binary" | |
| sudo "$binary" | |
| done | |
| integration_tests: | |
| runs-on: self-hosted | |
| timeout-minutes: 30 | |
| needs: build | |
| steps: | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "build-cache" | |
| cache-on-failure: true | |
| cache-directories: | | |
| ~/.cargo/bin | |
| ~/.cargo/registry/index | |
| ~/.cargo/registry/cache | |
| ~/.cargo/git/db | |
| target/ | |
| # Download the built enclave binaries | |
| - name: Download enclave binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: enclave-binaries | |
| path: target/debug/ | |
| # Make enclave binaries executable | |
| - name: Make enclave binaries executable | |
| run: | | |
| echo "current directory: $PWD" | |
| ls -la target/debug/seismic-* | |
| chmod +x target/debug/seismic-enclave* | |
| chmod +x target/debug/seismic-enclave-server* | |
| echo "Made enclave binaries executable:" | |
| ls -la target/debug/seismic-* | |
| # Checkout seismic-reth into subdir | |
| - name: Checkout seismic-reth | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: SeismicSystems/seismic-reth | |
| path: seismic-reth | |
| clean: false | |
| fetch-depth: 0 | |
| # Build seismic-reth using manifest path | |
| # cargo sweep will delete files in target older than 1 day | |
| - name: Build seismic-reth | |
| run: | | |
| cargo install cargo-sweep | |
| cargo build --bin seismic-reth --manifest-path seismic-reth/Cargo.toml | |
| cargo sweep --time 1 --recursive | |
| echo "Current working directory: $PWD" | |
| echo "Full path of seismic-reth binary:" | |
| find $PWD/seismic-reth/target/debug -name "seismic-reth" -type f -executable -exec realpath {} \; | |
| # Checkout the current repo (enclave) | |
| - name: Checkout enclave repo | |
| uses: actions/checkout@v4 | |
| with: | |
| clean: false | |
| fetch-depth: 0 | |
| # Make integration test script executable | |
| - name: Make test script executable | |
| run: chmod +x scripts/run_integration_tests.sh | |
| # Debug: Check if binary exists and supervisor config | |
| - name: Debug binary and supervisor config | |
| run: | | |
| echo "=== Checking if seismic-reth binary exists ===" | |
| ls -la /home/azureuser/actions-runner/_work/enclave/enclave/seismic-reth/target/debug/seismic-reth || echo "Binary not found" | |
| echo "=== Checking if seismic-enclave-server binary exists ===" | |
| ls -la /home/azureuser/actions-runner/_work/enclave/enclave/target/debug/seismic-enclave-server || echo "seismic-enclave-server binary not found" | |
| echo "=== Current working directory ===" | |
| pwd | |
| echo "=== Supervisor config ===" | |
| sudo cat /etc/supervisor/conf.d/devnet.conf || echo "No supervisor config found" | |
| echo "=== Checking supervisor status ===" | |
| sudo supervisorctl status || echo "Supervisor not running" | |
| # Run the integration tests | |
| - name: Run integration tests | |
| run: ./scripts/run_integration_tests.sh | |
| - name: Cleanup artifacts from target | |
| run: | | |
| rm -rf target/debug/seismic-* |