forked from Birditch/AndroidTreeView
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (87 loc) · 2.71 KB
/
Copy pathci.yml
File metadata and controls
105 lines (87 loc) · 2.71 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
DOTNET_NOLOGO: "true"
DOTNET_CLI_TELEMETRY_OPTOUT: "true"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "true"
CONFIGURATION: Release
SOLUTION: AndroidTreeView.sln
jobs:
build-test:
name: Build & Test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Restore
run: dotnet restore ${{ env.SOLUTION }} -p:EnableWindowsTargeting=true
- name: Build
run: dotnet build ${{ env.SOLUTION }} -c ${{ env.CONFIGURATION }} --no-restore -p:EnableWindowsTargeting=true
- name: Test
run: >-
dotnet test ${{ env.SOLUTION }}
-c ${{ env.CONFIGURATION }}
--no-build
-p:EnableWindowsTargeting=true
--logger trx
--results-directory test-results
- name: Upload test results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-${{ matrix.os }}
path: test-results/**/*.trx
if-no-files-found: warn
vulnerabilities:
name: Vulnerability scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Restore
run: dotnet restore ${{ env.SOLUTION }} -p:EnableWindowsTargeting=true
- name: Check for vulnerable packages
shell: bash
run: |
set -euo pipefail
dotnet list ${{ env.SOLUTION }} package --vulnerable --include-transitive 2>&1 | tee vulnerable.log
if grep -q "has the following vulnerable packages" vulnerable.log; then
echo "::error::Vulnerable NuGet packages detected. See the log above."
exit 1
fi
echo "No vulnerable packages detected."
format:
name: Format check (non-blocking)
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Restore
run: dotnet restore ${{ env.SOLUTION }} -p:EnableWindowsTargeting=true
- name: dotnet format --verify-no-changes
run: dotnet format ${{ env.SOLUTION }} --verify-no-changes --verbosity diagnostic