diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82ef8f33edb..21a1c6154a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,11 +22,19 @@ jobs: name: Smoketests strategy: matrix: + runner: [spacetimedb-new-runner, windows-latest] include: - - { runner: spacetimedb-runner, smoketest_args: --docker } - - { runner: windows-latest, smoketest_args: --no-build-cli } - runner: [ spacetimedb-runner, windows-latest ] + - runner: spacetimedb-new-runner + smoketest_args: --docker + container: + image: localhost:5000/spacetimedb-ci:latest + options: --privileged + - runner: windows-latest + smoketest_args: --no-build-cli + container: null runs-on: ${{ matrix.runner }} + container: ${{ matrix.container }} + steps: - name: Find Git ref env: @@ -63,6 +71,10 @@ jobs: if: runner.os == 'Windows' run: choco install psql -y --no-progress shell: powershell + - name: Start Docker daemon + if: runner.os == 'Linux' + run: /usr/local/bin/start-docker.sh + - name: Build and start database (Linux) if: runner.os == 'Linux' run: docker compose up -d @@ -93,7 +105,11 @@ jobs: test: name: Test Suite - runs-on: spacetimedb-runner + runs-on: spacetimedb-new-runner + container: + image: localhost:5000/spacetimedb-ci:latest + options: >- + --privileged steps: - name: Find Git ref env: @@ -140,8 +156,9 @@ jobs: #Note: Unreal tests will be run separately run: cargo test --all -- --skip unreal + # The fallocate tests have been flakely when running in parallel - name: Run fallocate tests - run: cargo test -p spacetimedb-durability --features fallocate + run: cargo test -p spacetimedb-durability --features fallocate -- --test-threads=1 - name: Check that the test outputs are up-to-date run: bash tools/check-diff.sh @@ -157,7 +174,11 @@ jobs: lints: name: Lints - runs-on: spacetimedb-runner + runs-on: spacetimedb-new-runner + container: + image: localhost:5000/spacetimedb-ci:latest + options: >- + --privileged steps: - name: Checkout sources uses: actions/checkout@v3 @@ -196,7 +217,11 @@ jobs: wasm_bindings: name: Build and test wasm bindings - runs-on: spacetimedb-runner + runs-on: spacetimedb-new-runner + container: + image: localhost:5000/spacetimedb-ci:latest + options: >- + --privileged steps: - uses: actions/checkout@v3 @@ -221,7 +246,11 @@ jobs: publish_checks: name: Check that packages are publishable - runs-on: ubuntu-latest + runs-on: spacetimedb-new-runner + container: + image: localhost:5000/spacetimedb-ci:latest + options: >- + --privileged permissions: read-all steps: - uses: actions/checkout@v3 @@ -289,7 +318,7 @@ jobs: name: Unreal Engine Tests # This can't go on e.g. ubuntu-latest because that runner runs out of disk space. ChatGPT suggested that the general solution tends to be to use # a custom runner. - runs-on: spacetimedb-runner + runs-on: spacetimedb-new-runner # Skip if this is an external contribution. GitHub secrets will be empty, so the step would fail anyway. if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }} container: @@ -368,13 +397,17 @@ jobs: cd "$GITHUB_WORKSPACE/sdks/unreal" cargo --version - cargo test + cargo test -- --test-threads=1 ' cli_docs: name: Check CLI docs permissions: read-all - runs-on: ubuntu-latest + runs-on: spacetimedb-new-runner + container: + image: localhost:5000/spacetimedb-ci:latest + options: >- + --privileged steps: - name: Find Git ref env: diff --git a/.github/workflows/csharp-test.yml b/.github/workflows/csharp-test.yml index 8bb3f766cc2..2f9e5b4f6b7 100644 --- a/.github/workflows/csharp-test.yml +++ b/.github/workflows/csharp-test.yml @@ -12,7 +12,12 @@ concurrency: jobs: unity-testsuite: - runs-on: spacetimedb-runner + runs-on: spacetimedb-new-runner + container: + image: localhost:5000/spacetimedb-ci:latest + options: >- + --privileged + --cgroupns=host # Cancel any previous testsuites running on the same PR and/or ref. concurrency: group: unity-test-${{ github.event.pull_request.number || github.ref }} @@ -81,7 +86,7 @@ jobs: 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). - ln -sf $HOME/.cargo/bin/spacetimedb-cli $HOME/.cargo/bin/spacetime + ln -sf $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime env: # Share the target directory with our local project to avoid rebuilding same SpacetimeDB crates twice. CARGO_TARGET_DIR: demo/Blackholio/server-rust/target @@ -157,6 +162,9 @@ jobs: key: Unity-${{ github.head_ref }} restore-keys: Unity- + # We need this to support "Docker in Docker" + - name: Start Docker daemon + run: /usr/local/bin/start-docker.sh - name: Run Unity tests uses: game-ci/unity-test-runner@v4 with: