Skip to content

Commit a54f828

Browse files
committed
fix: Use shared actions-common for CodeQL build setup
Reuse reactiveui/actions-common dotnet-environment and dotnet-build actions instead of ad-hoc SDK/workload installation. This matches the CI build pipeline and handles workloads correctly.
1 parent 5ddb025 commit a54f828

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ jobs:
1616
analyze-csharp:
1717
name: Analyze C#
1818
runs-on: ubuntu-latest
19+
env:
20+
DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE: 1
1921

2022
steps:
2123
- name: Checkout repository
22-
uses: actions/checkout@v4
24+
uses: actions/checkout@v6
2325
with:
2426
fetch-depth: 0
2527

26-
- name: Setup .NET
27-
uses: actions/setup-dotnet@v4
28+
- name: Setup .NET Environment
29+
uses: reactiveui/actions-common/.github/actions/dotnet-environment@main
2830
with:
29-
dotnet-version: |
31+
dotnet-versions: |
3032
8.0.x
3133
9.0.x
3234
10.0.x
33-
34-
- name: Install Android SDK
35-
run: dotnet build src/ReactiveUI/ReactiveUI.csproj -t:InstallAndroidDependencies -f net10.0-android -p:AndroidSdkDirectory=$HOME/android-sdk -p:JavaSdkDirectory=$HOME/android-jdk -p:AcceptAndroidSDKLicenses=True
36-
37-
- name: Install Android SDK (net9)
38-
run: dotnet build src/ReactiveUI/ReactiveUI.csproj -t:InstallAndroidDependencies -f net9.0-android -p:AndroidSdkDirectory=$HOME/android-sdk -p:JavaSdkDirectory=$HOME/android-jdk -p:AcceptAndroidSDKLicenses=True
35+
src-folder: src
36+
solution-file: reactiveui.slnx
37+
install-workloads: 'true'
38+
use-nbgv: 'false'
3939

4040
- name: Initialize CodeQL
4141
uses: github/codeql-action/init@v4
@@ -44,10 +44,12 @@ jobs:
4444
build-mode: manual
4545

4646
- name: Build
47-
env:
48-
ANDROID_HOME: ${{ github.workspace }}/../android-sdk
49-
JAVA_HOME: ${{ github.workspace }}/../android-jdk
50-
run: dotnet build src/reactiveui.slnx -c Release
47+
uses: reactiveui/actions-common/.github/actions/dotnet-build@main
48+
with:
49+
configuration: Release
50+
src-folder: src
51+
solution-file: reactiveui.slnx
52+
create-packages: 'false'
5153

5254
- name: Perform CodeQL Analysis
5355
uses: github/codeql-action/analyze@v4
@@ -60,7 +62,7 @@ jobs:
6062

6163
steps:
6264
- name: Checkout repository
63-
uses: actions/checkout@v4
65+
uses: actions/checkout@v6
6466

6567
- name: Initialize CodeQL
6668
uses: github/codeql-action/init@v4

0 commit comments

Comments
 (0)