-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.63 KB
/
dotnet-test.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
name: dotnet Build and Test
on: pull_request
jobs:
check-license:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{secrets.SUB_MODULE_PAT}}
submodules: recursive
- name: Check License Headers
run: npx license-check-and-add check -f ./tools/license/licenseconfig.json
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{secrets.SUB_MODULE_PAT}}
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Find and Replace Version templates
run: |
sed -i.bak 's/${VERSION}/0.0.1/g' src/Nitric.Sdk/Nitric.Sdk.csproj
- name: Restore dependencies
run: dotnet restore
- name: Generate Dependencies
run: make generate
- name: Build
run: dotnet build --no-restore --no-dependencies
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Check Dependency Licensing
run: |
dotnet tool install --global dotnet-project-licenses
echo "['MIT','Apache-2.0','BSD-3-Clause']" > licenses.json
echo "['Google.Protobuf']" > filter.json
echo "['Nitric.Sdk.csproj']" > packageFilter.json
dotnet-project-licenses -i src/Nitric.Sdk --allowed-license-types licenses.json --projects-filter packageFilter.json --packages-filter filter.json
rm licenses.json
rm filter.json
dotnet tool uninstall --global dotnet-project-licenses