Add more SDK support #9
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: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| # Cancel in-progress runs for the same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # ========================================================================== | |
| # Formatting & Linting | |
| # ========================================================================== | |
| format-check: | |
| name: Format Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Check formatting | |
| run: bun run format:check | |
| # ========================================================================== | |
| # TypeScript Tests | |
| # ========================================================================== | |
| typescript: | |
| name: TypeScript Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: tests/typescript | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Lint | |
| run: bun run lint | |
| continue-on-error: true | |
| - name: Run required tests | |
| run: bun run test:required | |
| continue-on-error: true # Tests depend on testnet which may be flaky | |
| - name: Run preferred tests | |
| run: bun run test:preferred | |
| continue-on-error: true | |
| - name: Run optional tests | |
| run: bun run test:optional | |
| continue-on-error: true | |
| # ========================================================================== | |
| # Go Tests | |
| # ========================================================================== | |
| go: | |
| name: Go Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: tests/go | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| cache-dependency-path: tests/go/go.sum | |
| - name: Install dependencies | |
| run: go mod download | |
| - name: Lint | |
| run: go vet ./... | |
| continue-on-error: true | |
| - name: Run required tests | |
| run: make test-required | |
| continue-on-error: true # Tests depend on testnet which may be flaky | |
| - name: Run preferred tests | |
| run: make test-preferred | |
| continue-on-error: true | |
| - name: Run optional tests | |
| run: make test-optional | |
| continue-on-error: true | |
| # ========================================================================== | |
| # Rust Tests | |
| # ========================================================================== | |
| rust: | |
| name: Rust Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: tests/rust | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout aptos-rust-sdk | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: aptos-labs/aptos-rust-sdk | |
| path: aptos-rust-sdk-checkout | |
| - name: Link SDK to expected location | |
| run: | | |
| # Cargo.toml expects aptos-rust-sdk at ../../../aptos-rust-sdk relative to tests/rust | |
| # That resolves to the parent of this repo. Create symlink at that level. | |
| # From workspace root, go up one level and create the symlink there | |
| ln -sf $GITHUB_WORKSPACE/aptos-rust-sdk-checkout $GITHUB_WORKSPACE/../aptos-rust-sdk | |
| ls -la $GITHUB_WORKSPACE/../ | |
| working-directory: ${{ github.workspace }} | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| tests/rust/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('tests/rust/Cargo.lock') }} | |
| - name: Lint | |
| run: cargo clippy --test specs -- -D warnings | |
| continue-on-error: true | |
| - name: Run required tests | |
| run: make test-required | |
| continue-on-error: true # Tests depend on external SDK and testnet | |
| - name: Run preferred tests | |
| run: make test-preferred | |
| continue-on-error: true | |
| # ========================================================================== | |
| # Python Tests | |
| # ========================================================================== | |
| python: | |
| name: Python Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: tests/python | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| cache-dependency-path: tests/python/requirements.txt | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Lint | |
| run: python -m flake8 steps/ support/ || true | |
| continue-on-error: true | |
| - name: Setup steps symlink | |
| run: | | |
| # Create symlink so behave can find steps from the features directory | |
| # Target is relative to where the symlink is placed (features/) | |
| ln -sf ../tests/python/steps ../../features/steps | |
| ln -sf ../tests/python/environment.py ../../features/environment.py | |
| - name: Run required tests | |
| run: make test-required | |
| continue-on-error: true # Tests depend on testnet which may be flaky | |
| - name: Run preferred tests | |
| run: make test-preferred | |
| continue-on-error: true | |
| # ========================================================================== | |
| # .NET Tests | |
| # ========================================================================== | |
| dotnet: | |
| name: .NET Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: tests/dotnet | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "8.0.x" | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore | |
| - name: Run required tests | |
| run: make test-required | |
| continue-on-error: true # Tests depend on testnet which may be flaky | |
| - name: Run preferred tests | |
| run: make test-preferred | |
| continue-on-error: true | |
| # ========================================================================== | |
| # Java Tests | |
| # ========================================================================== | |
| java: | |
| name: Java Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: tests/java | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version: "21" | |
| cache: "maven" | |
| - name: Run required tests | |
| run: make test-required | |
| continue-on-error: true # Tests depend on testnet which may be flaky | |
| - name: Run preferred tests | |
| run: make test-preferred | |
| continue-on-error: true | |
| # ========================================================================== | |
| # Kotlin Tests | |
| # ========================================================================== | |
| kotlin: | |
| name: Kotlin Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: tests/kotlin | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version: "21" | |
| cache: "gradle" | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Run required tests | |
| run: make test-required | |
| continue-on-error: true # Tests depend on testnet which may be flaky | |
| - name: Run preferred tests | |
| run: make test-preferred | |
| continue-on-error: true | |
| # ========================================================================== | |
| # Swift Tests (macOS only) | |
| # ========================================================================== | |
| swift: | |
| name: Swift Tests | |
| runs-on: macos-latest | |
| defaults: | |
| run: | |
| working-directory: tests/swift | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup features | |
| run: make link-features | |
| - name: Build | |
| run: swift build | |
| - name: Run tests | |
| run: swift test | |
| continue-on-error: true | |
| # ========================================================================== | |
| # C++ Tests (disabled - SDK not yet available) | |
| # ========================================================================== | |
| # cpp: | |
| # name: C++ Tests | |
| # runs-on: ubuntu-latest | |
| # defaults: | |
| # run: | |
| # working-directory: tests/cpp | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # | |
| # - name: Install dependencies | |
| # run: | | |
| # sudo apt-get update | |
| # sudo apt-get install -y cmake ninja-build | |
| # | |
| # - name: Setup Conan | |
| # run: | | |
| # pip install conan | |
| # conan profile detect | |
| # | |
| # - name: Install Conan dependencies | |
| # run: conan install . --output-folder=build --build=missing | |
| # | |
| # - name: Build | |
| # run: | | |
| # cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -G Ninja | |
| # cmake --build build | |
| # | |
| # - name: Run tests | |
| # run: ./build/aptos_spec_tests ../../features --tags "@required" | |
| # continue-on-error: true | |
| # ========================================================================== | |
| # Summary Job | |
| # ========================================================================== | |
| ci-success: | |
| name: CI Success | |
| runs-on: ubuntu-latest | |
| needs: | |
| - format-check | |
| - typescript | |
| - go | |
| - rust | |
| - python | |
| - dotnet | |
| - java | |
| - kotlin | |
| - swift | |
| # - cpp # disabled | |
| if: always() | |
| steps: | |
| - name: Check required jobs | |
| run: | | |
| # Only format check is required - SDK tests depend on external services | |
| if [[ "${{ needs.format-check.result }}" != "success" ]]; then | |
| echo "Format check failed" | |
| exit 1 | |
| fi | |
| # Report on SDK test results (informational) | |
| echo "=== SDK Test Results (informational) ===" | |
| echo "TypeScript: ${{ needs.typescript.result }}" | |
| echo "Go: ${{ needs.go.result }}" | |
| echo "Rust: ${{ needs.rust.result }}" | |
| echo "Python: ${{ needs.python.result }}" | |
| echo ".NET: ${{ needs.dotnet.result }}" | |
| echo "Java: ${{ needs.java.result }}" | |
| echo "Kotlin: ${{ needs.kotlin.result }}" | |
| echo "Swift: ${{ needs.swift.result }}" | |
| # echo "C++: ${{ needs.cpp.result }}" # disabled | |
| echo "" | |
| echo "Note: SDK tests depend on external services (testnet, faucet)" | |
| echo "and may fail due to network issues, not code problems." | |
| echo "" | |
| echo "Format check passed - CI successful!" |