Skip to content

Commit 9484a6c

Browse files
authored
ci: Add an Ubuntu:22.04 builder for RISC-V (#219)
cpuinfo is built for riscv64 using a riscv64 container. binfmt_misc allows the riscv64 binaries in the container to be executed with QEMU. This is slower than cross compiling but as there's not that much code the build times are acceptable. It takes just under 6 minutes for the full riscv64 github action to run. We also have the option of running some of the built RISC-V binaries, e.g., unit tests, in the CI. It should be easy to expand the matrix to add CI for other architectures not natively supported by github actions.
1 parent 434970b commit 9484a6c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,26 @@ jobs:
9393
working-directory: ${{ github.workspace }}
9494
env:
9595
ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
96+
cmake-linux-qemu:
97+
runs-on: ubuntu-22.04
98+
timeout-minutes: 40
99+
strategy:
100+
matrix:
101+
build_props:
102+
- [
103+
"cmake-linux-riscv64",
104+
"riscv64/ubuntu:22.04"
105+
]
106+
107+
name: ${{ matrix.build_props[0] }}
108+
steps:
109+
- uses: actions/checkout@v2
110+
- name: Setup QEMU
111+
uses: docker/setup-qemu-action@v3.0.0
112+
- name: Build cpuinfo in ${{ matrix.build_props[1] }}
113+
run: |
114+
docker run -i -v $(pwd):/cpuinfo ${{ matrix.build_props[1] }} /bin/bash -c "
115+
apt update &&
116+
apt install -y cmake git gcc g++ &&
117+
cd /cpuinfo &&
118+
scripts/local-build.sh"

0 commit comments

Comments
 (0)