ci: add loongarch64 #57
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cross | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
tags: '*' | |
jobs: | |
build-cross-qemu: | |
# TODO: We need Ubuntu 24.04 to use newer version of qemu, | |
# switch to ubuntu-latest when `ubuntu-latest >= 24.04` | |
runs-on: ubuntu-24.04 | |
name: build-cross-qemu-${{ matrix.config.arch }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { arch: arm, triple: arm-linux-gnueabihf } | |
- { arch: aarch64, triple: aarch64-linux-gnu } | |
- { arch: ppc, triple: powerpc-linux-gnu } | |
- { arch: ppc64, triple: powerpc64-linux-gnu } | |
- { arch: ppc64le, triple: powerpc64le-linux-gnu } | |
- { arch: mips, triple: mips-linux-gnu } | |
- { arch: mipsel, triple: mipsel-linux-gnu } | |
# Builds successfully, but tests fail. | |
# - { arch: mips64, triple: mips64-linux-gnuabi64 } | |
# - { arch: mips64el, triple: mips64el-linux-gnuabi64 } | |
- { arch: riscv64, triple: riscv64-linux-gnu } | |
- { arch: s390x, triple: s390x-linux-gnu } | |
- { arch: loongarch64, triple: loongarch64-linux-gnu } | |
env: | |
ARCH: ${{ matrix.config.arch }} | |
TRIPLE: ${{ matrix.config.triple }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install qemu | |
run: | | |
sudo apt update | |
sudo apt install -y qemu-user qemu-user-binfmt | |
- name: Install gcc-${{ matrix.config.triple }} | |
if: ${{ 'loongarch64' != matrix.config.arch }} | |
run: sudo apt install -y gcc-$TRIPLE | |
- name: Install gcc-${{ matrix.config.triple }} | |
if: ${{ 'loongarch64' == matrix.config.arch }} | |
# package gcc-loongarch64-linux-gnu seems not exist | |
# https://packages.debian.org/sid/amd64/gcc-loongarch64-linux-gnu | |
run: sudo apt install -y gcc-14-loongarch64-linux-gnu cpp-loongarch64-linux-gnu | |
- name: Build with ${{ matrix.config.triple }}-gcc | |
run: make ARCH=$ARCH TOOLPREFIX=$TRIPLE- | |
- name: Build tests | |
run: make -C test ARCH=$ARCH TOOLPREFIX=$TRIPLE- | |
- name: Run Tests | |
env: | |
QEMU_EXEC: qemu-${{ matrix.config.arch }} | |
CROSS_LIB: /usr/${{ matrix.config.triple }} | |
run: | | |
$QEMU_EXEC -L . -L $CROSS_LIB/ test/test-float | |
$QEMU_EXEC -L . -L $CROSS_LIB/ test/test-double |