diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7d2f058e..69441f9af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -280,6 +280,8 @@ jobs: ref: ${{ env.GIT_REF }} - uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 with: @@ -332,6 +334,8 @@ jobs: uses: actions/checkout@v3 - uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - run: echo ::add-matcher::.github/workflows/rust_matcher.json - name: Cache Rust dependencies @@ -359,6 +363,8 @@ jobs: - uses: actions/checkout@v3 - uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - run: echo ::add-matcher::.github/workflows/rust_matcher.json - name: Cache Rust dependencies @@ -379,6 +385,9 @@ jobs: permissions: read-all steps: - uses: actions/checkout@v3 + - uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - name: Set up Python env run: | test -d venv || python3 -m venv venv @@ -415,6 +424,8 @@ jobs: - name: Install Rust uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - name: Install rust target run: rustup target add ${{ matrix.target }} @@ -489,6 +500,8 @@ jobs: with: ref: ${{ env.GIT_REF }} - uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - name: Run Unreal Engine tests working-directory: sdks/unreal env: @@ -559,6 +572,8 @@ jobs: ref: ${{ env.GIT_REF }} - uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - name: Check for docs change run: cargo ci self-docs --check @@ -611,6 +626,8 @@ jobs: ${{ runner.os }}-pnpm-store- - uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 @@ -709,6 +726,8 @@ jobs: - name: Install Rust toolchain uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 @@ -735,6 +754,8 @@ jobs: - name: Install SpacetimeDB CLI from the local checkout run: | + export CARGO_HOME="$HOME/.cargo" + echo "$CARGO_HOME/bin" >> "$GITHUB_PATH" cargo install --force --path crates/cli --locked --message-format=short cargo install --force --path crates/standalone --locked --message-format=short # Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules). @@ -845,6 +866,8 @@ jobs: - name: Install Rust toolchain uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 @@ -877,6 +900,8 @@ jobs: - name: Install SpacetimeDB CLI from the local checkout run: | + export CARGO_HOME="$HOME/.cargo" + echo "$CARGO_HOME/bin" >> "$GITHUB_PATH" cargo install --force --path crates/cli --locked --message-format=short cargo install --force --path crates/standalone --locked --message-format=short # Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules). @@ -1062,6 +1087,8 @@ jobs: ref: ${{ env.GIT_REF }} - uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 09ecff1e3..2c72693bd 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -41,6 +41,8 @@ jobs: - name: Install Rust uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - name: Install rust target run: rustup target add ${{ matrix.target }} diff --git a/.github/workflows/typescript-test.yml b/.github/workflows/typescript-test.yml index 2d8b17ade..edbbe89fc 100644 --- a/.github/workflows/typescript-test.yml +++ b/.github/workflows/typescript-test.yml @@ -76,6 +76,8 @@ jobs: - name: Install Rust toolchain uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 @@ -99,29 +101,23 @@ jobs: cargo clean -p v8 || true cargo build -p v8 fi + if ! [ -f "${CARGO_TARGET_DIR}"/release/gn_out/obj/librusty_v8.a ]; then + echo "Could not find v8 output file librusty_v8.a; rebuilding manually." + cargo clean --release -p v8 || true + cargo build --release -p v8 + fi - name: Install SpacetimeDB CLI from the local checkout run: | + export CARGO_HOME="$HOME/.cargo" + echo "$CARGO_HOME/bin" >> "$GITHUB_PATH" cargo install --force --path crates/cli --locked --message-format=short cargo install --force --path crates/standalone --locked --message-format=short # Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules). - rm -f $CARGO_HOME/bin/spacetime - ln -s $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime + ln -sf $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime # Clear any existing information spacetime server clear -y - # This step shouldn't be needed, but somehow we end up with caches that are missing librusty_v8.a. - # This may be due to reusing CARGO_TARGET_DIR while mixing different build strategies (`cargo install` and `cargo build -p`). - # However, this fix seems to work. - - name: Check v8 outputs - run: | - find "${CARGO_TARGET_DIR}"/ -type f | grep '[/_]v8' || true - if ! [ -f "${CARGO_TARGET_DIR}"/debug/gn_out/obj/librusty_v8.a ]; then - echo "Could not find v8 output file librusty_v8.a; rebuilding manually." - cargo clean -p v8 || true - cargo build -p v8 - fi - - name: Generate client bindings working-directory: templates/chat-react-ts run: | diff --git a/.github/workflows/upgrade-version-check.yml b/.github/workflows/upgrade-version-check.yml index ee2b29819..be209c5c1 100644 --- a/.github/workflows/upgrade-version-check.yml +++ b/.github/workflows/upgrade-version-check.yml @@ -12,6 +12,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - uses: dsherret/rust-toolchain-file@v1 + - name: Set default rust toolchain + run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) # pnpm is required for regenerating the typescript bindings - name: Set up Node.js uses: actions/setup-node@v4