Feature: block storage and block tree #174
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: Run Tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| use_cache: | |
| description: 'Use cache for build' | |
| required: true | |
| default: 'true' | |
| type: 'choice' | |
| options: | |
| - 'true' | |
| - 'false' | |
| env: | |
| USE_CACHE: ${{ github.event.inputs.use_cache || 'true' }} | |
| CACHE_VERSION: v02 | |
| CARGO_HOME: ~/.cargo | |
| RUSTUP_HOME: ~/.rustup | |
| CACHE_PATH: | | |
| ~/.cargo | |
| ~/.hunter | |
| ~/.cache/pip | |
| ~/.cache/vcpkg | |
| .vcpkg | |
| .venv | |
| .build | |
| jobs: | |
| build-and-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04, macos-15] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: "Set up Rust" | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - name: "Restore cache dependencies" | |
| id: cache-restore | |
| if: ${{ env.USE_CACHE == 'true' }} | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ env.CACHE_PATH }} | |
| key: jam-${{ runner.os }}-${{ github.job }}-${{ env.CACHE_VERSION }}-${{ github.run_id }} | |
| restore-keys: | | |
| jam-${{ runner.os }}-${{ github.job }}-${{ env.CACHE_VERSION }} | |
| jam-${{ runner.os }}-${{ github.job }} | |
| jam-${{ runner.os }} | |
| - name: "Basic init" | |
| run: | | |
| if [[ $RUNNER_OS == "Linux" ]]; then | |
| sudo ./.ci/scripts/init.sh | |
| else | |
| ./.ci/scripts/init.sh | |
| fi | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| # Ensure Rust is available | |
| source "$HOME/.cargo/env" || true | |
| echo "CARGO_HOME=$HOME/.cargo" >> $GITHUB_ENV | |
| echo "RUSTUP_HOME=$HOME/.rustup" >> $GITHUB_ENV | |
| - name: "Init all dependencies" | |
| run: | | |
| make init_py | |
| make init_vcpkg | |
| - name: "Check Rust toolchain" | |
| run: | | |
| echo "=== Checking Rust toolchain ===" | |
| which rustc || echo "rustc not found" | |
| which cargo || echo "cargo not found" | |
| rustc --version || echo "rustc version check failed" | |
| cargo --version || echo "cargo version check failed" | |
| echo "PATH: $PATH" | |
| echo "CARGO_HOME: $CARGO_HOME" | |
| echo "RUSTUP_HOME: $RUSTUP_HOME" | |
| - name: "Configure" | |
| run: make configure | |
| - name: "Build" | |
| run: make build | |
| - name: "Test" | |
| run: make test | |
| - name: "Always Save Cache" | |
| id: cache-save | |
| if: always() && ( steps.cache-restore.outputs.cache-hit != 'true' ) | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ env.CACHE_PATH }} | |
| key: ${{ steps.cache-restore.outputs.cache-primary-key }} |