Skip to content

Instantly share code, notes, and snippets.

@KieranBond
Last active November 19, 2023 17:20
Show Gist options
  • Select an option

  • Save KieranBond/ea2c1d6416a7fc10a9bfbb00b0f4e152 to your computer and use it in GitHub Desktop.

Select an option

Save KieranBond/ea2c1d6416a7fc10a9bfbb00b0f4e152 to your computer and use it in GitHub Desktop.
Test a .NET project with the 3 Musketeers - Repo that this works with here: https://github.com/KieranBond/Net-Musketeer-Base
version: "3.8"
services:
dotnet:
image: mcr.microsoft.com/dotnet/sdk:latest
working_dir: /app/app/src
volumes:
- .:/app
RUN_DOTNET=docker compose run dotnet
.PHONY: build test
build:
echo "Running make build"
$(RUN_DOTNET) dotnet build
test: build
echo "Running make test"
$(RUN_DOTNET) ./unit-test.sh
#!/usr/bin/env bash
set -eo pipefail
echo "Running unit tests"
# Expected to have run a build step before test, so we don't need to build nor restore the .NET project
dotnet test --no-build --no-restore
echo "finishing tests"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment