Skip to content

Fix dismissal causing duplicate companions #5257

Fix dismissal causing duplicate companions

Fix dismissal causing duplicate companions #5257

Workflow file for this run

name: Build and Test
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# Cancel superseded runs when a PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
if: ${{ !github.event.pull_request.draft }}
container:
image: garrettluskey/bannerlordcoop:latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Link Game Assemblies Folder
run: ln -s /home/mb2 mb2
- name: Cache NuGet Packages
uses: actions/cache@v6
with:
path: ${{ github.workspace }}/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('source/**/*.csproj') }}
restore-keys: |
nuget-${{ runner.os }}-
# CoopTests.slnf contains the test projects that can build and run on Linux (plus their
# production dependencies such as Coop.Core and GameInterface). The full solution includes
# legacy net472 projects (Coop, Missions, ClientDebug, MissionTestMod and the
# Missions-dependent MissionTests) that require Windows.
- name: Build Solution
working-directory: source
run: dotnet build CoopTests.slnf -c Release
- name: Upload Build Output
uses: actions/upload-artifact@v7
with:
name: build-output
path: source/*/bin/**
retention-days: 1
if-no-files-found: error
test:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: build
container:
image: garrettluskey/bannerlordcoop:latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Link Game Assemblies Folder
run: ln -s /home/mb2 mb2
- name: Cache NuGet Packages
uses: actions/cache@v6
with:
path: ${{ github.workspace }}/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('source/**/*.csproj') }}
restore-keys: |
nuget-${{ runner.os }}-
- name: Download Build Output
uses: actions/download-artifact@v8
with:
name: build-output
path: source
# Restore recreates the NuGet assets (obj/) that --no-build project evaluation needs;
# the binaries under bin/ come from the build job's artifact, so nothing is recompiled.
- name: Restore Test Assets
working-directory: source
run: dotnet restore CoopTests.slnf
- name: Run Unit Tests
working-directory: source
run: dotnet test CoopUnitTests.slnf -c Release --no-build --no-restore --consoleLoggerParameters:ErrorsOnly
e2e:
name: E2E Tests (${{ matrix.shard }})
runs-on: ubuntu-latest
timeout-minutes: 10
needs: build
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3, 4, 5, 6, 7]
container:
image: garrettluskey/bannerlordcoop:latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Link Game Assemblies Folder
run: ln -s /home/mb2 mb2
- name: Cache NuGet Packages
uses: actions/cache@v6
with:
path: ${{ github.workspace }}/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('source/**/*.csproj') }}
restore-keys: |
nuget-${{ runner.os }}-
- name: Download Build Output
uses: actions/download-artifact@v8
with:
name: build-output
path: source
- name: Restore Test Assets
working-directory: source
run: dotnet restore CoopTests.slnf
- name: Run E2E Test Shard
working-directory: source
run: sh ../.github/scripts/run-e2e-shard.sh "${{ matrix.shard }}" 8