Fix error with the install script #10022
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
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| merge_group: | |
| workflow_dispatch: | |
| inputs: | |
| pr_number: | |
| description: 'Pull Request Number' | |
| required: false | |
| default: '' | |
| name: CI | |
| jobs: | |
| docker_smoketests: | |
| name: Smoketests | |
| strategy: | |
| matrix: | |
| include: | |
| - { runner: spacetimedb-runner, smoketest_args: --docker } | |
| - { runner: windows-latest, smoketest_args: --no-build-cli } | |
| runner: [spacetimedb-runner, windows-latest] | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Find Git ref | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: bash | |
| run: | | |
| PR_NUMBER="${{ github.event.inputs.pr_number || null }}" | |
| if test -n "${PR_NUMBER}"; then | |
| GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )" | |
| else | |
| GIT_REF="${{ github.ref }}" | |
| fi | |
| echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV" | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.GIT_REF }} | |
| - uses: dsherret/rust-toolchain-file@v1 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| global-json-file: modules/global.json | |
| - name: Build and start database (Linux) | |
| if: runner.os == 'Linux' | |
| run: docker compose up -d | |
| - name: Build and start database (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| cargo build -p spacetimedb-cli -p spacetimedb-standalone -p spacetimedb-update | |
| Start-Process target/debug/spacetimedb-cli.exe start | |
| cd modules | |
| # the sdk-manifests on windows-latest are messed up, so we need to update them | |
| dotnet workload config --update-mode workload-set | |
| dotnet workload update | |
| - uses: actions/setup-python@v5 | |
| with: { python-version: '3.12' } | |
| if: runner.os == 'Windows' | |
| - name: Run smoketests | |
| # Note: clear_database only works in private | |
| run: python -m smoketests ${{ matrix.smoketest_args }} -x clear_database | |
| - name: Stop containers (Linux) | |
| if: always() && runner.os == 'Linux' | |
| run: docker compose down | |
| test: | |
| name: Test Suite | |
| runs-on: spacetimedb-runner | |
| steps: | |
| - name: Find Git ref | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| PR_NUMBER="${{ github.event.inputs.pr_number || null }}" | |
| if test -n "${PR_NUMBER}"; then | |
| GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )" | |
| else | |
| GIT_REF="${{ github.ref }}" | |
| fi | |
| echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV" | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.GIT_REF }} | |
| - uses: dsherret/rust-toolchain-file@v1 | |
| - uses: actions/setup-dotnet@v3 | |
| with: | |
| global-json-file: modules/global.json | |
| - name: Create /stdb dir | |
| run: | | |
| sudo mkdir /stdb | |
| sudo chmod 777 /stdb | |
| - name: Run cargo test | |
| run: cargo test --all | |
| - name: Check that the test outputs are up-to-date | |
| run: git diff --exit-code | |
| - name: Ensure C# autogen bindings are up-to-date | |
| run: | | |
| cargo run --example regen-csharp-moduledef | |
| git diff --exit-code -- crates/bindings-csharp | |
| - name: C# bindings tests | |
| working-directory: crates/bindings-csharp | |
| run: dotnet test -warnaserror | |
| sdk_test: | |
| name: SDK Tests | |
| runs-on: spacetimedb-runner | |
| steps: | |
| - name: Find Git ref | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| PR_NUMBER="${{ github.event.inputs.pr_number || null }}" | |
| if test -n "${PR_NUMBER}"; then | |
| GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )" | |
| else | |
| GIT_REF="${{ github.ref }}" | |
| fi | |
| echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV" | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.GIT_REF }} | |
| - uses: dsherret/rust-toolchain-file@v1 | |
| - uses: actions/setup-dotnet@v3 | |
| with: | |
| global-json-file: modules/global.json | |
| - name: Create /stdb dir | |
| run: | | |
| sudo mkdir /stdb | |
| sudo chmod 777 /stdb | |
| - name: Checkout C# SDK | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: clockworklabs/spacetimedb-csharp-sdk | |
| ref: master | |
| path: spacetimedb-csharp-sdk | |
| - name: Setup NuGet override for C# SDK | |
| working-directory: spacetimedb-csharp-sdk | |
| run: | | |
| dotnet pack ../crates/bindings-csharp/BSATN.Runtime | |
| # The SDK package overrides the following crate for use in their tests. | |
| # Even though it doesn't actually depend on it, we still need to pack it | |
| # so dotnet doesn't complain. | |
| dotnet pack ../crates/bindings-csharp/Runtime | |
| ./tools~/write-nuget-config.sh .. | |
| # clear package caches, so we get fresh ones even if version numbers haven't changed | |
| dotnet nuget locals all --clear | |
| - name: Run C# SDK tests | |
| working-directory: spacetimedb-csharp-sdk | |
| run: dotnet test | |
| lints: | |
| name: Lints | |
| runs-on: spacetimedb-runner | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v3 | |
| - uses: dsherret/rust-toolchain-file@v1 | |
| - run: echo ::add-matcher::.github/workflows/rust_matcher.json | |
| - name: Run cargo fmt | |
| run: cargo fmt --all -- --check | |
| - name: Run cargo clippy | |
| run: cargo clippy --all --tests --benches -- -D warnings | |
| - name: Run C# formatting check | |
| working-directory: crates/bindings-csharp | |
| run: | | |
| dotnet tool restore | |
| dotnet csharpier --check . | |
| - name: Run `cargo doc` for bindings crate | |
| # `bindings` is the only crate we care strongly about documenting, | |
| # since we link to its docs.rs from our website. | |
| # We won't pass `--no-deps`, though, | |
| # since we want everything reachable through it to also work. | |
| # This includes `sats` and `lib`. | |
| working-directory: crates/bindings | |
| env: | |
| # Make `cargo doc` exit with error on warnings, most notably broken links | |
| RUSTDOCFLAGS: '--deny warnings' | |
| run: | | |
| cargo doc | |
| wasm_bindings: | |
| name: Build and test wasm bindings | |
| runs-on: spacetimedb-runner | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: dsherret/rust-toolchain-file@v1 | |
| - run: echo ::add-matcher::.github/workflows/rust_matcher.json | |
| - name: Build module-test | |
| run: cargo run -p spacetimedb-cli -- build --project-path modules/module-test | |
| - name: Run bindgen tests | |
| run: cargo test -p spacetimedb-cli |