mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 08:43:02 +08:00
138 lines
3.9 KiB
YAML
138 lines
3.9 KiB
YAML
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-linux-x64:
|
|
name: Test linux-x64
|
|
if: ${{ inputs.platform == 'linux-x64' }}
|
|
runs-on: 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
|
|
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: Upload test artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: partnerctl-linux-x64-test
|
|
path: PartnerCtl/target/partnerctl
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
|
|
test-linux-arm64:
|
|
name: Test linux-arm64
|
|
if: ${{ inputs.platform == 'linux-arm64' }}
|
|
runs-on: ubuntu-24.04-arm
|
|
|
|
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
|
|
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: Upload test artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: partnerctl-linux-arm64-test
|
|
path: PartnerCtl/target/partnerctl
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
|
|
test-windows-x64:
|
|
name: Test windows-x64
|
|
if: ${{ inputs.platform == 'windows-x64' }}
|
|
runs-on: windows-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 Windows output
|
|
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-windows-x64-test
|
|
path: PartnerCtl/target/partnerctl.exe
|
|
if-no-files-found: error
|
|
retention-days: 1
|