forked from tomchavakis/nuget-license
-
-
Notifications
You must be signed in to change notification settings - Fork 9
92 lines (72 loc) · 2.67 KB
/
action.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: "Main workflow"
on: [pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
buildConfiguration: "Release"
- os: windows-latest
buildConfiguration: "TestWindows"
- os: macos-latest
buildConfiguration: "Release"
steps:
- uses: actions/checkout@v4
- name: Setup dotnet 6.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "6.0.x"
- name: Setup dotnet 7.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "7.0.x"
- name: Setup dotnet 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: restore
run: dotnet restore
- name: build
run: dotnet build --configuration ${{ matrix.buildConfiguration }} --no-restore
- name: test
run: dotnet test --configuration ${{ matrix.buildConfiguration }} --no-restore
check_code_format:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Add dotnet-format problem matcher
uses: xt0rted/dotnet-format-problem-matcher@v1
- name: Restore dotnet tools
uses: xt0rted/dotnet-tool-restore@v1
- name: Run dotnet format
uses: xt0rted/dotnet-format@v1
with:
only-changed-files: "true"
check_licenses:
runs-on: ubuntu-latest
strategy:
matrix:
targetFramework: [net6.0, net7.0, net8.0]
include:
- targetFramework: net6.0
dotnetVersion: "6.0.x"
- targetFramework: net7.0
dotnetVersion: "7.0.x"
- targetFramework: net8.0
dotnetVersion: "8.0.x"
steps:
- uses: actions/checkout@v4
- name: Setup dotnet ${{ matrix.dotnetVersion }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnetVersion }}
- name: restore
run: dotnet restore -p:TargetFramework=${{ matrix.targetFramework }}
- name: build
run: dotnet publish ./src/NuGetUtility/NuGetUtility.csproj --configuration Release -o ./release -f ${{ matrix.targetFramework }} --no-restore
- name: check
run: dotnet ./release/NuGetUtility.dll -ji ./.github/workflows/assets/projectsToCheck.json -t -a ./.github/workflows/assets/allowedLicenses.json -o JsonPretty -override ./.github/workflows/assets/overwritePackageInformation.json -ignore ./.github/workflows/assets/ignorePackages.json -mapping ./.github/workflows/assets/urlToLicenseMapping.json