-
Notifications
You must be signed in to change notification settings - Fork 22
23 lines (18 loc) · 1.09 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
name: Run Tests
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: windows-latest # NOTE: Has to be Windows because the old .NET Framework 4.x (which is one of the target frameworks of the test project) is Windows-only
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x # NOTE: The `windows-latest` container already comes pre-installed with the .NET versions that we need, but we do need to use `setup-dotnet` (and pass it one of the versions — e.g. 7.0.x), so that the relevant binaries (e.g. `dotnet`) are actually added to PATH so we can use them. See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#preinstalled-software and https://github.com/actions/setup-dotnet
# TODO: Some .NET codebases with GitHub Actions workflows seem to run `dotnet restore`, `dotnet build` and `dotnet test` as separate steps. Why?
- name: Run the tests
run: dotnet test --configuration Release