Skip to content

Adds a maintenance door variant for Journalism access #20349

Adds a maintenance door variant for Journalism access

Adds a maintenance door variant for Journalism access #20349

name: Build & Test Debug
# Cancel older jobs on PRs when new changes are pushed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
on:
push:
branches: [ master, staging, stable, Starlight, starlight-dev, upstream-devtest, fix/tests ]
merge_group:
pull_request:
types: [ opened, reopened, synchronize, ready_for_review ]
branches: [ master, staging, stable, Starlight, starlight-dev, upstream-devtest ]
jobs:
build:
if: github.actor != 'PJBot' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout Master
uses: actions/checkout@v7
- name: Setup Submodule
run: |
git submodule update --init --recursive
- name: Pull engine updates
uses: space-wizards/submodule-dependency@v0.1.5
- name: Update Engine Submodules
run: |
cd RobustToolbox/
git submodule update --init --recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Install dependencies
run: dotnet restore
- name: Build Project
run: dotnet build --configuration DebugOpt --no-restore /m
- name: Discover Integration Tests
run: |
dotnet test --list-tests --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj 2>&1 | \
python3 Tools/_Starlight/partition_tests.py generate 8 .integration-filters
- name: Archive build output
run: tar --use-compress-program='zstd -T0' -cf /tmp/build.tar.zst --exclude='.git' .
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build-output
path: /tmp/build.tar.zst
retention-days: 1
compression-level: 0
content-tests:
needs: build
name: Content Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Setup .NET Core
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Download build artifact
uses: actions/download-artifact@v8
with:
name: build-output
- name: Extract build
run: tar --use-compress-program='zstd -d -T0' -xf build.tar.zst && rm build.tar.zst
- name: Restore packages
run: dotnet restore Content.Tests/Content.Tests.csproj
- name: Run Content.Tests
uses: nick-fields/retry@v4
with:
timeout_minutes: 15
max_attempts: 2
command: dotnet test --no-build --configuration DebugOpt Content.Tests/Content.Tests.csproj --logger "trx;LogFileName=results.trx" --results-directory /tmp/test-results
- name: Test results
continue-on-error: true
if: always()
run: |
dotnet tool install -g dotnet-trx 2>/dev/null || true
mkdir -p /tmp/test-results
trx --path /tmp/test-results -o -v verbose || true
integration-tests:
needs: build
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3, 4, 5, 6, 7]
name: "Integration Tests (shard ${{ matrix.shard }})"
runs-on: ubuntu-latest
steps:
- name: Setup .NET Core
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Download build artifact
uses: actions/download-artifact@v8
with:
name: build-output
- name: Extract build
run: tar --use-compress-program='zstd -d -T0' -xf build.tar.zst && rm build.tar.zst
- name: Restore packages
run: dotnet restore Content.IntegrationTests/Content.IntegrationTests.csproj
- name: Run Content.IntegrationTests
id: run-integration-tests
uses: nick-fields/retry@v4
env:
DOTNET_gcServer: "1"
with:
timeout_minutes: 17
max_attempts: 2
retry_on: any
command: |
RUNSETTINGS=".integration-filters/shard_${{ matrix.shard }}.runsettings"
if [ ! -f "$RUNSETTINGS" ]; then
echo "No tests assigned to shard ${{ matrix.shard }}"
exit 0
fi
timeout --signal=TERM --kill-after=2m 15m \
dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj --logger "trx;LogFileName=results.trx" --logger "console;verbosity=normal" --results-directory /tmp/test-results --blame-hang --blame-hang-timeout 3min --settings "$RUNSETTINGS"
- name: Test results
continue-on-error: true
if: always()
run: |
dotnet tool install -g dotnet-trx 2>/dev/null || true
mkdir -p /tmp/test-results
trx --path /tmp/test-results -o -v verbose || true
- name: Upload crash dumps
id: upload-dumps
uses: actions/upload-artifact@v4
if: ${{ always() && steps.run-integration-tests.outcome == 'failure' }}
with:
name: blame-dump-shard-${{ matrix.shard }}
path: |
/tmp/test-results/**/*.dmp
/tmp/test-results/**/*Sequence*.xml
retention-days: 3
if-no-files-found: ignore
- name: Report hung tests
continue-on-error: true
if: always()
run: |
shopt -s nullglob globstar
found=false
for seq in /tmp/test-results/**/*Sequence*.xml; do
if [ "$found" = false ]; then
echo "## :warning: Hung tests detected (shard ${{ matrix.shard }})" >> "$GITHUB_STEP_SUMMARY"
echo '```xml' >> "$GITHUB_STEP_SUMMARY"
found=true
fi
cat "$seq" >> "$GITHUB_STEP_SUMMARY"
done
if [ "$found" = true ]; then
echo '```' >> "$GITHUB_STEP_SUMMARY"
if [ -n "${{ steps.upload-dumps.outputs.artifact-url }}" ]; then
echo ":floppy_disk: [Download crash dump](${{ steps.upload-dumps.outputs.artifact-url }})" >> "$GITHUB_STEP_SUMMARY"
fi
fi
ci-success:
name: Debug CI Required
if: ${{ always() }}
needs:
- build
- content-tests
- integration-tests
runs-on: ubuntu-latest
steps:
- name: Fail if any dependency was not successful
if: ${{ needs.build.result != 'success' || needs['content-tests'].result != 'success' || needs['integration-tests'].result != 'success' }}
run: |
echo "build=${{ needs.build.result }}"
echo "content-tests=${{ needs['content-tests'].result }}"
echo "integration-tests=${{ needs['integration-tests'].result }}"
exit 1
- name: CI succeeded
run: exit 0
cleanup:
name: Cleanup Artifacts
needs:
- content-tests
- integration-tests
if: always()
runs-on: ubuntu-latest
steps:
- name: Delete build artifact
uses: geekyeggo/delete-artifact@v5
with:
name: build-output