From cc99e565f0d6507e97daed43defbe75fe9097008 Mon Sep 17 00:00:00 2001 From: slhaf Date: Mon, 11 May 2026 11:25:37 +0800 Subject: [PATCH] chore(ci): add partnerctl native build test workflow --- .github/workflows/test-partnerctl-native.yml | 77 ++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/test-partnerctl-native.yml diff --git a/.github/workflows/test-partnerctl-native.yml b/.github/workflows/test-partnerctl-native.yml new file mode 100644 index 00000000..3c6165a4 --- /dev/null +++ b/.github/workflows/test-partnerctl-native.yml @@ -0,0 +1,77 @@ +name: Test PartnerCtl Native Build + +on: + workflow_dispatch: + inputs: + platform: + description: "Target platform to test" + required: true + default: "windows-x64" + type: choice + options: + - windows-x64 + - linux-x64 + - linux-arm64 + +permissions: + contents: read + +jobs: + test-native-build: + name: Test ${{ inputs.platform }} + runs-on: ${{ + inputs.platform == 'windows-x64' && 'windows-latest' || + inputs.platform == 'linux-arm64' && 'ubuntu-24.04-arm' || + 'ubuntu-latest' + }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up GraalVM 21 + uses: graalvm/setup-graalvm@v1 + with: + distribution: graalvm-community + java-version: "21" + github-token: ${{ github.token }} + + - name: Build partnerctl native image + run: mvn -B -DskipTests=true -pl PartnerCtl -am package native:compile + + - name: Check Linux output + if: ${{ inputs.platform == 'linux-x64' || inputs.platform == 'linux-arm64' }} + shell: bash + run: | + if [ ! -f "PartnerCtl/target/partnerctl" ]; then + echo "Expected native binary not found: PartnerCtl/target/partnerctl" + echo "Available PartnerCtl target files:" + find PartnerCtl/target -maxdepth 2 -type f -print + exit 1 + fi + + chmod +x PartnerCtl/target/partnerctl + ./PartnerCtl/target/partnerctl --help + + - name: Check Windows output + if: ${{ inputs.platform == 'windows-x64' }} + shell: pwsh + run: | + if (!(Test-Path "PartnerCtl/target/partnerctl.exe")) { + Write-Host "Expected native binary not found: PartnerCtl/target/partnerctl.exe" + Write-Host "Available PartnerCtl target files:" + Get-ChildItem -Recurse PartnerCtl/target | Select-Object FullName + throw "partnerctl.exe not found" + } + + .\PartnerCtl\target\partnerctl.exe --help + + - name: Upload test artifact + uses: actions/upload-artifact@v4 + with: + name: partnerctl-${{ inputs.platform }}-test + path: | + PartnerCtl/target/partnerctl + PartnerCtl/target/partnerctl.exe + if-no-files-found: ignore + retention-days: 1