Repository navigation
51 lines (48 loc) · 1.49 KB
/
Copy pathcsharp.yml
File metadata and controls
51 lines (48 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
test-fx:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up dotnet.
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: "11.0.x"
- name: Build
run: dotnet build --framework net48
- name: Run test suite
run: dotnet test --framework net48
test-net:
strategy:
matrix:
version:
- "10.0"
- "11.0"
runs-on: ubuntu-latest
name: Test dotnet
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up dotnet.
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: "11.0.x"
- name: Build
run: dotnet build --framework net${{ matrix.version }}
- name: Run test suite
run: dotnet test --framework net${{ matrix.version }}
# Single stable check for branch protection, so the ruleset does not need
# to change when the matrix does.
tests-passed:
if: always()
needs: [test-fx, test-net]
runs-on: ubuntu-latest
steps:
- name: Fail if any test job failed or was cancelled
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1