STR-2366-update-l1payload-for-the-admin-transaction #305
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: Functional tests | |
| on: | |
| workflow_call: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| concurrency: | |
| group: functional-tests-${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| lint: | |
| name: Lint functional test files | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0 | |
| with: | |
| working-directory: functional-tests | |
| activate-environment: true | |
| enable-cache: true | |
| cache-suffix: "functional-tests" | |
| python-version: "3.12" | |
| - name: Check formatting | |
| working-directory: functional-tests | |
| run: uv run ruff format --check | |
| - name: Check types | |
| working-directory: functional-tests | |
| run: uv run ty check | |
| - name: Lint | |
| working-directory: functional-tests | |
| run: uv run ruff check | |
| run: | |
| name: Run functional tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Install bitcoind | |
| env: | |
| BITCOIND_VERSION: "30.2" | |
| BITCOIND_ARCH: "x86_64-linux-gnu" | |
| run: | | |
| curl -fsSLO --proto "=https" --tlsv1.3 "https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-$BITCOIND_ARCH.tar.gz" | |
| curl -fsSLO --proto "=https" --tlsv1.3 "https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/SHA256SUMS" | |
| sha256sum --ignore-missing --check SHA256SUMS | |
| tar xzf "bitcoin-$BITCOIND_VERSION-$BITCOIND_ARCH.tar.gz" | |
| sudo install -m 0755 -t /usr/local/bin bitcoin-"$BITCOIND_VERSION"/bin/* | |
| bitcoind --version | |
| rm -rf SHA256SUMS "bitcoin-$BITCOIND_VERSION" "bitcoin-$BITCOIND_VERSION-$BITCOIND_ARCH.tar.gz" | |
| - name: Install Rust toolchain | |
| run: | | |
| rustup toolchain install nightly --profile minimal --component llvm-tools-preview | |
| rustup default nightly | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@81ecf985428d5c2ea81dbf079bceca32bc9604ab # v2.62.43 | |
| with: | |
| tool: cargo-llvm-cov | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2 | |
| with: | |
| cache-on-failure: true | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0 | |
| with: | |
| working-directory: functional-tests | |
| activate-environment: true | |
| enable-cache: true | |
| cache-suffix: "functional-tests" | |
| python-version: "3.12" | |
| - name: Build with coverage instrumentation | |
| run: | | |
| COV_TARGET_DIR="$GITHUB_WORKSPACE/target/llvm-cov-target" | |
| RUSTFLAGS="-Cinstrument-coverage" cargo build --locked --bin strata-asm-runner --target-dir "$COV_TARGET_DIR" | |
| - name: Run functional tests | |
| id: funcTestsRun | |
| continue-on-error: true | |
| env: | |
| NO_COLOR: "1" | |
| LOG_LEVEL: "info" | |
| run: | | |
| export LLVM_PROFILE_FILE="$GITHUB_WORKSPACE/target/llvm-cov-target/asm-%p-%m.profraw" | |
| NEWPATH="$GITHUB_WORKSPACE/target/llvm-cov-target/debug" | |
| export PATH="$NEWPATH:$PATH" | |
| export STRATA_ASM_RUNNER_BIN="$NEWPATH/strata-asm-runner" | |
| cd functional-tests | |
| source ./env.bash | |
| uv run python entry.py | |
| - name: Generate coverage lcov | |
| id: genFunctionalLcov | |
| continue-on-error: true | |
| run: | | |
| export CARGO_TARGET_DIR="$GITHUB_WORKSPACE/target" | |
| export LLVM_PROFILE_FILE="$GITHUB_WORKSPACE/target/llvm-cov-target/asm-%p-%m.profraw" | |
| cargo llvm-cov report --lcov > lcov.functional.info | |
| - name: Upload coverage lcov artifact | |
| if: steps.genFunctionalLcov.outcome == 'success' | |
| continue-on-error: true | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: functional-lcov | |
| path: lcov.functional.info | |
| - name: Fail job if functional tests fail | |
| if: steps.funcTestsRun.outcome == 'failure' | |
| run: | | |
| echo "Functional tests failed" | |
| exit 1 | |
| functional-success: | |
| name: Check that functional tests pass | |
| runs-on: ubuntu-latest | |
| if: always() | |
| needs: | |
| - lint | |
| - run | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Decide whether the needed jobs succeeded or failed | |
| uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |