This commit is contained in:
Kelechi Ebiri 2025-06-02 18:47:17 +02:00 committed by GitHub
commit 49e282bc91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 80 additions and 1 deletions

74
.github/workflows/linux-arm.yml vendored Normal file
View file

@ -0,0 +1,74 @@
name: Linux Arm Build and Test
on:
workflow_call:
inputs:
profile:
required: true
type: string
unit-tests:
required: true
type: boolean
build-libservo:
required: true
type: boolean
bencher:
required: true
type: boolean
workflow_dispatch:
inputs:
profile:
required: true
type: string
unit-tests:
required: true
type: boolean
build-libservo:
required: true
type: boolean
bencher:
required: true
type: boolean
jobs:
linux-arm:
name: Linux Arm
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Setup Rust Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Bootstrap Dependencies
run: |
sudo apt update
./mach bootstrap --skip-lints
- name: Build libservo for ARM
run: |
# Build for ARM using the appropriate target
./mach build --release --target=aarch64-unknown-linux-gnu
- name: Run Unit Tests
if: ${{ inputs.unit-tests }}
run: |
./mach test-unit --release --target=aarch64-unknown-linux-gnu
- name: Build libservo with examples
if: ${{ inputs.build-libservo }}
run: cargo build --target=aarch64-unknown-linux-gnu -p libservo --all-targets
- name: Run Bencher
if: ${{ inputs.bencher }}
run: |
./mach test-bencher --release -- target=aarch64-unknown-linux-gnu

View file

@ -28,6 +28,7 @@ class Workflow(str, Enum):
ANDROID = "android"
OHOS = "ohos"
LINT = "lint"
LINUX_ARM = "linux-arm"
@dataclass
@ -64,6 +65,8 @@ class JobConfig(object):
def update_name(self):
if self.workflow is Workflow.LINUX:
self.name = "Linux"
elif self.workflow is Workflow.LINUX_ARM:
self.name = "Linux ARM"
elif self.workflow is Workflow.MACOS:
self.name = "MacOS"
elif self.workflow is Workflow.WINDOWS:
@ -90,7 +93,9 @@ class JobConfig(object):
def handle_preset(s: str) -> Optional[JobConfig]:
s = s.lower()
if any(word in s for word in ["linux"]):
if s == "linux-arm" or any(word in s for word in ["arm"]):
return JobConfig("Linux ARM", Workflow.LINUX_ARM)
elif any(word in s for word in ["linux"]):
return JobConfig("Linux", Workflow.LINUX)
elif any(word in s for word in ["mac", "macos"]):
return JobConfig("MacOS", Workflow.MACOS)