-
-
Notifications
You must be signed in to change notification settings - Fork 61
78 lines (68 loc) · 2.25 KB
/
dotnetcore.yml
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
# For details of what checks are run for PRs please refer below
name: .NET Core CI
on: [pull_request, workflow_dispatch]
env:
SNAPSHOOTER_STRICT_MODE: true
jobs:
# Fail if there are build warnings
#
# To check for build warnings locally you may need to run a clean build.
#
# This can be done by running `dotnet clean` before running `dotnet build`
build-warnings:
name: Build warnings check
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-dotnet@v3.0.2
with:
dotnet-version: '6.0'
- name: Build
run: dotnet build /WarnAsError
# We end up targeting a range of runtimes, make sure they all build
build:
name: Runtime build check
runs-on: ubuntu-20.04
strategy:
matrix:
runtime: [linux-x64, linux-musl-x64, linux-arm, linux-arm64, win-x64, win-x86, win-arm, win-arm64, osx-x64, osx-arm64]
timeout-minutes: 30
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-dotnet@v3.0.2
with:
dotnet-version: '6.0'
- name: Build
run: dotnet build src/cyclonedx/cyclonedx.csproj -r ${{ matrix.runtime }}
# Fail if there are any failed tests
#
# We support .NET 6.0 on Windows, Mac and Linux.
#
# To check for failing tests locally run `dotnet test`.
test:
name: Tests for .NET ${{ matrix.framework }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
# macos currently disabled. see issue https://github.com/SwissLife-OSS/snapshooter/issues/196.
os: [ubuntu-latest, windows-latest]
timeout-minutes: 30
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-dotnet@v3.0.2
with:
dotnet-version: '6.0'
- name: SnapshooterHotfixSymlinkLinux
if: matrix.os == 'ubuntu-latest'
run: sudo ln -s "$GITHUB_WORKSPACE" /_
shell: bash
- name: SnapshooterHotfixSymlinkWindows
if: matrix.os == 'windows-latest'
run: New-Item -ItemType SymbolicLink -Path "/_" -Target "$env:GITHUB_WORKSPACE"
shell: pwsh
- name: Tests
run: |
dotnet restore
dotnet test --framework net6.0