-
Notifications
You must be signed in to change notification settings - Fork 79
103 lines (90 loc) · 4.13 KB
/
Copy pathCSharpTest.yml
File metadata and controls
103 lines (90 loc) · 4.13 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: 'C# Test'
# No path filters, on purpose: this is the suite, and every change is one it can break.
# That also means it cannot carry the defect that silenced the benchmark for ninety-eight
# merged PRs -- a leading "./" in a path filter matches nothing, because filters are globs
# relative to the repository root. Check that before adding any filter here.
# https://github.com/asc-community/AngouriMath/issues/775
on:
push:
branches:
- master
pull_request:
branches:
- '*'
jobs:
Test:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
with:
submodules: 'recursive'
- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'
dotnet-quality: 'preview'
- name: Build Tests # We need it to be able to retry
run: |
dotnet add "Sources/Tests/UnitTests" package GitHubActionsTestLogger
dotnet build Sources/Tests/UnitTests
- name: Test if not to send
if: ${{ matrix.os != 'windows-latest' }}
run: |
dotnet test "Sources/Tests/UnitTests" -c Release -l GitHubActions -l "trx;LogFileName=results.trx" --results-directory "Sources/Tests/UnitTests/TestResults" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
# Where the suite's time goes, by the Area trait every test class carries, written to the
# job's summary. One leg is enough to see the breakdown, and running the tool builds the
# library once more. https://github.com/asc-community/AngouriMath/issues/1183
- name: 'Time by area'
if: ${{ always() && matrix.os == 'ubuntu-latest' }}
run: dotnet run AreaTimes
working-directory: Sources/Utils/Utils
- name: Test if to send
if: ${{ matrix.os == 'windows-latest' }}
run: |
cd Sources/Tests/UnitTests
dotnet test --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
cd ../../Utils/Utils
dotnet run CopyCovReport
- name: Info about the coverage report
if: ${{ matrix.os == 'windows-latest' }}
run: dir ./Sources/Tests/UnitTests/coverage.opencover.xml
- name: 'Upload report as artifact'
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-artifact@v6
with:
name: Report
path: ./Sources/Tests/UnitTests/coverage.opencover.xml
retention-days: 3
# The corpus gate reports solved / unsolved / wrong / error / timeout rather than pass or
# fail, and until now those numbers existed only in this job's log, which expires. This is
# the artefact half of https://github.com/asc-community/AngouriMath/issues/746 item 36; the
# per-commit history half is Sources/Tests/UnitTests/Corpus/corpus-baseline.tsv, which is
# committed, because an artefact cannot be diffed, cannot be attributed to the commit that
# moved a number, and expires.
#
# if: always() because a suite that fell over part way still measured the cases that ran,
# and those are the interesting ones when something has just broken. Uploaded from every
# operating system in the matrix: a verdict that differs between them is a finding.
#
# The glob spans bin/Debug and bin/Release because the two test steps above do not agree on
# the configuration -- the Windows one takes the default.
- name: 'Retain the corpus results'
if: always()
uses: actions/upload-artifact@v6
with:
name: corpus-report-${{ matrix.os }}-${{ github.sha }}
path: Sources/Tests/UnitTests/bin/**/corpus-report.tsv
if-no-files-found: warn
retention-days: 90
# `files`, not `file`. v5 of the action does not take `file`: it warns about an unexpected
# input, ignores the path, and searches the workspace instead, so the named report was never
# what made this flag.
- name: 'Send to codecov'
if: ${{ matrix.os == 'windows-latest' }}
uses: codecov/codecov-action@v5
with:
files: ./Sources/Tests/UnitTests/coverage.opencover.xml
flags: csharp