-
-
Notifications
You must be signed in to change notification settings - Fork 50
52 lines (45 loc) · 1.66 KB
/
Copy pathdead-code.yml
File metadata and controls
52 lines (45 loc) · 1.66 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
name: Dead Code
on:
pull_request:
paths:
- 'Packages/src/**/*.cs'
- 'tools/UnityCliLoop.DeadCodeScanner/**'
- 'tests/UnityCliLoop.DeadCodeScanner.Tests/**'
- 'scripts/check-dead-code.sh'
- '.github/workflows/dead-code.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
dead-code:
name: Dead Code Gate
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: Setup .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68
with:
dotnet-version: 10.0.x
- name: Test dead code scanner
run: dotnet test tests/UnityCliLoop.DeadCodeScanner.Tests/UnityCliLoop.DeadCodeScanner.Tests.csproj --configuration Release
# Keep every explanation out of the run block below: it is a folded scalar, so YAML
# joins its lines into one command and a '#' would comment out everything after it.
# --max-public-candidates tracks the measured PublicCandidate count with no slack
# (docs/dead-code-scanner.md). Lower it whenever triage removes a candidate, and
# raise it only together with the reason the new candidate has to stay.
- name: Scan for dead code
run: >
scripts/check-dead-code.sh
--root .
--scope public
--include-types true
--include-members true
--include-locals true
--include-test-only true
--include-kept false
--format table
--fail-on high-confidence
--max-public-candidates 37