-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (84 loc) · 2.78 KB
/
build_test.yml
File metadata and controls
84 lines (84 loc) · 2.78 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
name: build_test
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**/README.md'
- '**/.gitignore'
- '**/.gitmodules'
- '**/.editorconfig'
- '**/OnspringAzureADSyncer.sln'
- .github/**
- .vscode/**
- notes/**
- planning/**
branches:
- main
- beta
jobs:
build_and_test:
name: build_and_test
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.ACTIONS_PAT }}
submodules: 'recursive'
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
- name: Restore dependencies
run: dotnet restore
- name: Build on ${{ matrix.os }}
run: dotnet build --no-restore
- name: Test on ${{ matrix.os }}
run: dotnet test --environment ENVIRONMENT=testing --collect:"XPlat Code Coverage;Include=[OnspringAzureADSyncer]*" --no-build --verbosity normal
- name: Attempt to create coverage directory on linux or mac-os
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: mkdir -p tests/TestResults/coverage
- name: Attempt to create coverage directory on windows
if: matrix.os == 'windows-latest'
run: mkdir -force tests/TestResults/coverage
- name: Rename test coverage report
run: mv tests/TestResults/*/coverage.cobertura.xml tests/TestResults/coverage/${{ matrix.os }}-coverage.cobertura.xml
- name: Upload test coverage report for ${{ matrix.os }}
uses: actions/upload-artifact@v4
with:
name: test-coverage-${{ matrix.os }}
path: tests/TestResults/coverage/${{ matrix.os }}-coverage.cobertura.xml
test_coverage:
needs: build_and_test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.ACTIONS_PAT }}
submodules: 'recursive'
- name: Download ubuntu-latest report
uses: actions/download-artifact@v4
with:
name: test-coverage-ubuntu-latest
path: ./coverage
- name: Download windows-latest report
uses: actions/download-artifact@v4
with:
name: test-coverage-windows-latest
path: ./coverage
- name: Download macos-latest report
uses: actions/download-artifact@v4
with:
name: test-coverage-macos-latest
path: ./coverage
- name: Upload test coverage reports
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}