Skip to content

Commit 4698d57

Browse files
committed
arm ci build
1 parent 80c269c commit 4698d57

File tree

4 files changed

+49
-3
lines changed

4 files changed

+49
-3
lines changed

.github/workflows/linux-arm64.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Linux (aarch64)
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags:
7+
- '*'
8+
pull_request:
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Install aarch64 Toolchain
16+
run: sudo apt install g++-aarch64-linux-gnu qemu qemu-user qemu-user-static
17+
- name: Install Clang 17
18+
run: |
19+
wget https://apt.llvm.org/llvm.sh
20+
chmod +x ./llvm.sh
21+
sudo ./llvm.sh 17
22+
- name: Configure
23+
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DRPP_TEST=ON -DRPP_QEMU=ON
24+
env:
25+
CXX: clang++-17 --target=aarch64-linux-gnu
26+
CXXFLAGS: -march=armv8-a
27+
AR: aarch64-linux-gnu-ar
28+
AS: aarch64-linux-gnu-as
29+
LD: aarch64-linux-gnu-ld
30+
STRIP: aarch64-linux-gnu-strip
31+
- name: Build
32+
run: cmake --build build -- -j
33+
- name: Test
34+
run: ctest --test-dir build --output-on-failure

.github/workflows/linux.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ jobs:
1818
chmod +x ./llvm.sh
1919
sudo ./llvm.sh 17
2020
- name: Configure
21-
run: CXX=clang++-17 cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DRPP_TEST=ON
21+
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DRPP_TEST=ON
22+
env:
23+
CXX: clang++-17
2224
- name: Build
2325
run: cmake --build build -- -j
2426
- name: Test

.github/workflows/macos.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ jobs:
1515
- name: Install Clang 17
1616
run: brew install llvm@17
1717
- name: Configure
18-
run: CXX=/usr/local/opt/llvm/bin/clang++ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DRPP_TEST=ON
18+
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DRPP_TEST=ON
19+
env:
20+
CXX: /usr/local/opt/llvm/bin/clang++
1921
- name: Build
2022
run: cmake --build build -- -j
2123
- name: Test

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.17)
33
project(rpp LANGUAGES CXX)
44

55
option(RPP_TEST "Build tests" OFF)
6+
option(RPP_QEMU "Run tests with qemu-aarch64" OFF)
67

78
add_subdirectory("rpp/")
89

@@ -22,8 +23,15 @@ if(RPP_TEST)
2223

2324
foreach(test ${TEST_SOURCES})
2425
get_filename_component(testname ${test} NAME_WE)
26+
27+
if(RPP_QEMU)
28+
set(command qemu-aarch64 -L /usr/aarch64-linux-gnu/ $<TARGET_FILE:${testname}>)
29+
else()
30+
set(command $<TARGET_FILE:${testname}>)
31+
endif()
32+
2533
add_test(NAME ${testname}
26-
COMMAND $<TARGET_FILE:${testname}>
34+
COMMAND ${command}
2735
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test")
2836
endforeach(test ${TEST_SOURCES})
2937
endif()

0 commit comments

Comments
 (0)