-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (141 loc) · 4.95 KB
/
Copy pathdotnet.yml
File metadata and controls
160 lines (141 loc) · 4.95 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: .NET CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-test:
name: Build & Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore ProbotSharp.sln
- name: Build
run: dotnet build ProbotSharp.sln --configuration Release --no-restore
- name: Test with Coverage
run: dotnet test ProbotSharp.sln --configuration Debug --settings coverlet.runsettings --collect:"XPlat Code Coverage"
- name: Publish Coverage Report
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: "tests/**/TestResults/**/coverage.cobertura.xml"
fail_ci_if_error: false
verify-links:
name: Verify Markdown Links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: pip install requests
- name: Verify local links in Markdown files
run: python3 scripts/verify-local-links.py
- name: Verify GitHub links in Markdown files
run: python3 scripts/verify-github-links.py
verify-markdown-code:
name: Verify Markdown C# Code Blocks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore ProbotSharp.sln
- name: Build
run: dotnet build ProbotSharp.sln --configuration Release --no-restore
- name: Verify C# code blocks in Markdown files
run: bash scripts/verify-markdown-code.sh
test-examples:
name: Docker E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Test all examples
run: ./scripts/testing/test-all-examples.sh
timeout-minutes: 30
- name: Upload build logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: example-build-logs
path: /tmp/*_build.log
retention-days: 7
if-no-files-found: ignore
performance-trace:
name: Performance Trace
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dotnet-trace
run: dotnet tool install --global dotnet-trace
- name: Restore Dependencies
run: dotnet restore ProbotSharp.sln
- name: Restore HelloWorldBot
run: dotnet restore examples/HelloWorldBot/HelloWorldBot.csproj
- name: Build HelloWorldBot
run: dotnet build examples/HelloWorldBot/HelloWorldBot.csproj -c Release --no-restore
- name: Create dummy GitHub App private key
run: |
cat > /tmp/trace-dummy-key.pem <<'EOF'
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA0Z6Wh6dULwk3p0c2EhjRz1EOwN+R0EQJfzH3AwiBvT7nPzUG
----END RSA PRIVATE KEY-----
EOF
- name: Run HelloWorldBot in background
env:
PROBOTSHARP__GITHUB__APPID: "123456"
PROBOTSHARP__WEBHOOK_SECRET: "test-secret-for-tracing"
PROBOTSHARP__GITHUB__PRIVATEKEYPATH: "/tmp/trace-dummy-key.pem"
run: |
dotnet run --project examples/HelloWorldBot/HelloWorldBot.csproj -c Release &
echo $! > app.pid
- name: Wait for app to initialize
run: sleep 15
- name: Check if process is running
run: |
PID=$(cat app.pid)
echo "Checking if PID $PID is running..."
ps -p $PID || (echo "Process not running!" && exit 1)
echo "Process is alive and running"
- name: Collect performance trace
run: |
PID=$(cat app.pid)
echo "Collecting trace from PID $PID..."
dotnet-trace collect --pid $PID --duration 00:00:30 -o trace.nettrace
- name: Convert trace to Speedscope format
run: dotnet-trace convert trace.nettrace --format Speedscope
- name: Upload flamegraph artifact
uses: actions/upload-artifact@v4
with:
name: flamegraph
path: trace.speedscope.json
retention-days: 7
all-tests-passed:
name: All Tests Passed
runs-on: ubuntu-latest
needs: [build-test, verify-links, verify-markdown-code, test-examples, performance-trace]
steps:
- run: echo "✅ All tests passed successfully!"
k8s-validation:
name: K8s Validation Status
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- run: echo "ℹ️ Kubernetes validation runs separately in validate-kubernetes workflow"