-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (53 loc) · 2.92 KB
/
net.yml
File metadata and controls
65 lines (53 loc) · 2.92 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
name: Build NET Framework/Core
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.x
- name: Restore packages
run: |
dotnet restore
for s in SistemaDeAparcamiento Anaconda Palindromo MostRepeatedLetter PrimeNumber DivisorsAndSum Codewars SatelliteMessages MarsRover ArrayReordering LegacyAppRefactor; do
dotnet restore $s/$s.sln
done
- name: Install Coverlet
run: dotnet tool install --global coverlet.console
- name: Build solutions
run: |
dotnet build --configuration Debug --no-restore /p:DefineConstants="CI_CONTEXT"
for s in SistemaDeAparcamiento Anaconda Palindromo MostRepeatedLetter PrimeNumber DivisorsAndSum Codewars SatelliteMessages MarsRover ArrayReordering LegacyAppRefactor; do
dotnet build --configuration Debug --no-restore $s/$s.sln /p:DefineConstants="CI_CONTEXT"
done
- name: Testing NET Standalone Programs
run: |
coverlet SistemaDeAparcamiento/SistemaDeAparcamiento.Tests/bin/Debug/net9/SistemaDeAparcamiento.Tests.dll --target "dotnet" --targetargs "test SistemaDeAparcamiento/SistemaDeAparcamiento.Tests/SistemaDeAparcamiento.Tests.csproj --no-build --verbosity quiet" --format OpenCover --output sistemadeaparcamiento.coverage.xml
coverlet LegacyAppRefactor/LegacyApp.UnitTests/bin/Debug/net9/LegacyApp.UnitTests.dll --target "dotnet" --targetargs "test LegacyAppRefactor/LegacyApp.UnitTests/LegacyApp.UnitTests.csproj --no-build --verbosity quiet" --format OpenCover --output legacyapprefactor.coverage.xml
for s in Anaconda Palindromo MostRepeatedLetter PrimeNumber DivisorsAndSum SatelliteMessages MarsRover ArrayReordering; do
coverlet $s/$s.UnitTests/bin/Debug/net9/$s.UnitTests.dll --target "dotnet" --targetargs "test $s/$s.UnitTests/$s.UnitTests.csproj --no-build --verbosity quiet" --format OpenCover --output $s.coverage.xml
done
- name: Testing Codewars
run: |
for t in `ls -d1 ./Codewars/[0-9]kyu`; do
n=$(basename $t)
for s in `find ./Codewars/$n -maxdepth 1 -type d -printf "%f\n" | grep -v "kyu"`; do
coverlet Codewars/$n/$s/$s.UnitTests/bin/Debug/net9/$s.UnitTests.dll --target "dotnet" --targetargs "test Codewars/$n/$s/$s.UnitTests/$s.UnitTests.csproj --no-build --verbosity quiet" --format OpenCover --output $s.coverage.xml
done
done
- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v6
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Archive code coverage results
uses: actions/upload-artifact@v7
with:
name: code-coverage-report
path: ./*.coverage.xml