Last active
November 19, 2023 17:20
-
-
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
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
| version: "3.8" | |
| services: | |
| dotnet: | |
| image: mcr.microsoft.com/dotnet/sdk:latest | |
| working_dir: /app/app/src | |
| volumes: | |
| - .:/app |
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
| 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 |
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
| #!/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