-
Notifications
You must be signed in to change notification settings - Fork 42
143 lines (139 loc) · 6.97 KB
/
Copy pathdotnet.yml
File metadata and controls
143 lines (139 loc) · 6.97 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Build and Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
DOTNET_VERSION: 10.0.x
jobs:
build:
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: cd mzLib && dotnet restore
# Request the platform explicitly. The solution offers both x64 and Any CPU, and MSBuild silently
# prefers Any CPU as a solution's default, so an unqualified build would depend on that preference
# rather than on anything stated here. Any CPU is what the released package is built as.
- name: Build
run: cd mzLib && dotnet build --no-restore /p:Platform="Any CPU"
- name: Build (Test)
run: cd mzLib && dotnet build --no-restore ./Test/Test.csproj
# A '.' in a test name is spliced into the fully-qualified name, which Test Explorer / vstest
# split on '.' -- fragmenting the tree into phantom nodes that cannot be expanded or run.
# Runs before the suite so a naming regression fails in seconds rather than after the full run.
- name: Check test name hygiene
shell: pwsh
run: ./.github/scripts/Check-TestNameHygiene.ps1 -Project mzLib/Test/Test.csproj -NoBuild
- name: Add coverlet collector (Test)
run: cd mzLib && dotnet add Test/Test.csproj package coverlet.collector -v 6.0.2
- name: Test
# Exclude live external-service tests (Koina, etc.) from the required run; they run in the
# separate, non-blocking external-service job below. ExternalService supersedes the old Koina filter.
run: cd mzLib && dotnet test --no-build --verbosity normal --filter "Category!=ExternalService" --collect:"XPlat Code Coverage" /p:CoverletOutputFormat=cobertura ./Test/Test.csproj
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
verbose: true
files: mzLib/Test*/TestResults/*/coverage.cobertura.xml
# Runs mzLib's live external-service tests (Koina). Intentionally NOT a required status check, so a
# third-party outage never blocks a PR; the tests self-classify (outage -> Skipped, real break -> Fail).
# Do NOT add this job to branch-protection required checks.
external-service-tests:
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: cd mzLib && dotnet restore
- name: Build (Test)
run: cd mzLib && dotnet build --no-restore ./Test/Test.csproj
- name: Test (external services)
run: cd mzLib && dotnet test --no-build --verbosity normal --filter "Category=ExternalService" ./Test/Test.csproj
integration:
runs-on: windows-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
# This job builds MetaMorpheus as well as mzLib, so it needs whatever SDK MetaMorpheus's
# global.json asks for. setup-dotnet installs into a user-local dotnet root and the resolver then
# sees ONLY what this step installed, so the runner's preinstalled SDKs do not count. Both repos
# are on .NET 10, so one band. Note this job cannot pass while mzLib's target framework is ahead
# of MetaMorpheus's -- a net10.0-only package is NU1202-incompatible with a net8.0 consumer, which
# no amount of installed SDKs fixes -- so mzLib retargets only after MetaMorpheus does.
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: cd mzLib && dotnet restore
# Any CPU is requested explicitly so this job's output lands in bin/Release, which is where
# mzLib.nuspec looks. Relying on MSBuild's implicit preference for Any CPU would make the pack step
# below depend on the ordering of a platform list rather than on an intent stated here.
- name: Build
run: cd mzLib && dotnet build --no-restore --configuration Release /p:Platform="Any CPU"
- name: Change mzLib version, pack, add source
run: |
cd mzLib;
(Get-Content mzLib.nuspec) -replace "\<version\>(.*)\</version\>", "<version>9.9.9</version>" | Set-Content mzLib.nuspec;
$mzlibMatch = Select-String -Path mzLib.nuspec -Pattern "(?<=\<version\>)(.*)(?=\</version)";
$mzlibVersion = $mzlibMatch.Matches[0].Value;
echo "mzLib version number changed to: $mzlibVersion";
nuget pack;
$currentFolder = pwd;
dotnet nuget add source $currentFolder;
dotnet nuget list source;
- name: Clone MetaMorpheus
uses: actions/checkout@master
with:
path: ./MetaMorpheus
repository: smith-chem-wisc/MetaMorpheus
ref: master
- name: Change MetaMorpheus mzLib version and restore
run: |
cd ./MetaMorpheus/MetaMorpheus;
dotnet remove CMD/CMD.csproj package mzLib;
dotnet add CMD/CMD.csproj package mzLib -v 9.9.9;
dotnet remove GUI/GUI.csproj package mzLib;
dotnet add GUI/GUI.csproj package mzLib -v 9.9.9;
dotnet remove GuiFunctions/GuiFunctions.csproj package mzLib;
dotnet add GuiFunctions/GuiFunctions.csproj package mzLib -v 9.9.9;
dotnet remove EngineLayer/EngineLayer.csproj package mzLib;
dotnet add EngineLayer/EngineLayer.csproj package mzLib -v 9.9.9;
dotnet remove Test/Test.csproj package mzLib;
dotnet add Test/Test.csproj package mzLib -v 9.9.9;
dotnet remove TaskLayer/TaskLayer.csproj package mzLib;
dotnet add TaskLayer/TaskLayer.csproj package mzLib -v 9.9.9;
dotnet restore;
- name: Build MetaMorpheus
run: cd ./MetaMorpheus/MetaMorpheus && dotnet build --no-restore
- name: Test
# Exclude live external-service tests from the MetaMorpheus integration run: they gate on third-party
# services (UniProt, etc.), are not relevant to mzLib<->MetaMorpheus compatibility, and MetaMorpheus
# exercises them in its own non-blocking job. This is what keeps a UniProt outage from reddening
# every mzLib PR (this integration job clones MetaMorpheus master and runs its suite).
run: cd ./MetaMorpheus/MetaMorpheus && dotnet test --no-build --verbosity normal --filter "Category!=ExternalService"
- name: Upload artifact (installer)
uses: actions/upload-artifact@v4
with:
name: MetaMorpheusInstaller
path: ./MetaMorpheus/MetaMorpheus/MetaMorpheusSetup/bin/Debug/MetaMorpheusInstaller.msi
compression-level: 0
- name: Upload artifact (GUI)
uses: actions/upload-artifact@v4
with:
name: MetaMorpheusGUI
# Globbed rather than pinned to a framework: this is MetaMorpheus's target framework,
# not mzLib's, so the two repos can move independently.
path: ./MetaMorpheus/MetaMorpheus/GUI/bin/Debug/net*-windows/