Merge pull request #921 from maztah1/docs/wave-contributor-guide #1
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: Upgrade Tests | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths: | |
| - 'contracts/**' | |
| - '.github/workflows/upgrade-tests.yml' | |
| pull_request: | |
| branches: [main, develop] | |
| paths: | |
| - 'contracts/**' | |
| - '.github/workflows/upgrade-tests.yml' | |
| jobs: | |
| upgrade-tests: | |
| name: Contract Upgrade Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: ". -> target" | |
| # ── 1. State preservation tests ────────────────────────────────────── | |
| - name: Run state preservation tests | |
| run: | | |
| cargo test \ | |
| --manifest-path contracts/stellar-save/Cargo.toml \ | |
| upgrade_tests::upgrade_tests::test_migration \ | |
| -- --test-threads=1 --nocapture | |
| env: | |
| RUST_BACKTRACE: 1 | |
| # ── 2. API compatibility tests ──────────────────────────────────────── | |
| - name: Run API compatibility tests | |
| run: | | |
| cargo test \ | |
| --manifest-path contracts/stellar-save/Cargo.toml \ | |
| upgrade_tests::upgrade_tests::test_api \ | |
| -- --test-threads=1 --nocapture | |
| env: | |
| RUST_BACKTRACE: 1 | |
| # ── 3. Rollback scenario tests ──────────────────────────────────────── | |
| - name: Run rollback tests | |
| run: | | |
| cargo test \ | |
| --manifest-path contracts/stellar-save/Cargo.toml \ | |
| upgrade_tests::upgrade_tests::test_rollback \ | |
| -- --test-threads=1 --nocapture | |
| env: | |
| RUST_BACKTRACE: 1 | |
| # ── 4. Backward compatibility tests ────────────────────────────────── | |
| - name: Run backward compatibility tests | |
| run: | | |
| cargo test \ | |
| --manifest-path contracts/stellar-save/Cargo.toml \ | |
| upgrade_tests::upgrade_tests::test_backward_compat \ | |
| -- --test-threads=1 --nocapture | |
| env: | |
| RUST_BACKTRACE: 1 | |
| # ── 5. Schema version guard tests ──────────────────────────────────── | |
| - name: Run schema version guard tests | |
| run: | | |
| cargo test \ | |
| --manifest-path contracts/stellar-save/Cargo.toml \ | |
| upgrade_tests::upgrade_tests::test_schema_version_guard \ | |
| -- --test-threads=1 --nocapture | |
| env: | |
| RUST_BACKTRACE: 1 | |
| # ── 6. ContractConfig preservation tests ───────────────────────────── | |
| - name: Run config preservation tests | |
| run: | | |
| cargo test \ | |
| --manifest-path contracts/stellar-save/Cargo.toml \ | |
| upgrade_tests::upgrade_tests::test_config_preservation \ | |
| -- --test-threads=1 --nocapture | |
| env: | |
| RUST_BACKTRACE: 1 | |
| # ── 7. Token allowlist preservation tests ──────────────────────────── | |
| - name: Run token allowlist preservation tests | |
| run: | | |
| cargo test \ | |
| --manifest-path contracts/stellar-save/Cargo.toml \ | |
| upgrade_tests::upgrade_tests::test_token_allowlist \ | |
| -- --test-threads=1 --nocapture | |
| env: | |
| RUST_BACKTRACE: 1 | |
| # ── 8. Full lifecycle tests ─────────────────────────────────────────── | |
| - name: Run full lifecycle tests | |
| run: | | |
| cargo test \ | |
| --manifest-path contracts/stellar-save/Cargo.toml \ | |
| upgrade_tests::upgrade_tests::test_full_lifecycle \ | |
| -- --test-threads=1 --nocapture | |
| env: | |
| RUST_BACKTRACE: 1 | |
| # ── 9. Performance regression tests ────────────────────────────────── | |
| - name: Run performance regression tests | |
| run: | | |
| cargo test \ | |
| --manifest-path contracts/stellar-save/Cargo.toml \ | |
| upgrade_tests::upgrade_tests::test_perf \ | |
| -- --test-threads=1 --nocapture | |
| env: | |
| RUST_BACKTRACE: 1 | |
| # ── Full upgrade test suite (all 36 tests) ──────────────────────────── | |
| - name: Run full upgrade test suite | |
| run: | | |
| cargo test \ | |
| --manifest-path contracts/stellar-save/Cargo.toml \ | |
| upgrade_tests \ | |
| -- --test-threads=1 | |
| env: | |
| RUST_BACKTRACE: 1 | |
| - name: Verify contract still builds after upgrade tests | |
| run: | | |
| cargo build \ | |
| --manifest-path contracts/stellar-save/Cargo.toml \ | |
| --target wasm32-unknown-unknown \ | |
| --release | |
| env: | |
| RUST_BACKTRACE: 1 |