cross-loongarch64.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # merge this file into cross.yml
  2. # when we can `sudo apt install gcc-loongarch64-linux-gnu` on ubuntu
  3. name: Cross
  4. on:
  5. pull_request:
  6. branches:
  7. - master
  8. push:
  9. branches:
  10. - master
  11. tags: '*'
  12. jobs:
  13. build-cross-qemu:
  14. # TODO: We need Ubuntu 24.04 to use newer version of qemu,
  15. # switch to ubuntu-latest when `ubuntu-latest >= 24.04`
  16. runs-on: ubuntu-24.04
  17. name: build-cross-qemu-${{ matrix.config.arch }}
  18. strategy:
  19. fail-fast: false
  20. matrix:
  21. config:
  22. - { arch: loongarch64, triple: loongarch64-linux-gnu }
  23. env:
  24. ARCH: ${{ matrix.config.arch }}
  25. TRIPLE: ${{ matrix.config.triple }}
  26. steps:
  27. - uses: actions/checkout@v5
  28. - name: Install qemu
  29. run: |
  30. sudo apt update
  31. sudo apt install -y qemu-user qemu-user-binfmt
  32. - name: Install gcc-${{ matrix.config.triple }}
  33. # package gcc-loongarch64-linux-gnu seems not exist
  34. # https://packages.debian.org/sid/amd64/gcc-loongarch64-linux-gnu
  35. run: sudo apt install -y gcc-14-loongarch64-linux-gnu
  36. - name: Build with ${{ matrix.config.triple }}-gcc
  37. run: |
  38. make ARCH=$ARCH TOOLPREFIX=$TRIPLE- \
  39. CC='loongarch64-linux-gnu-gcc-14' \
  40. AR='loongarch64-linux-gnu-gcc-ar-14' \
  41. - name: Build tests
  42. run: |
  43. make -C test ARCH=$ARCH TOOLPREFIX=$TRIPLE- \
  44. CC='loongarch64-linux-gnu-gcc-14' \
  45. AR='loongarch64-linux-gnu-gcc-ar-14' \
  46. - name: Run Tests
  47. env:
  48. QEMU_EXEC: qemu-${{ matrix.config.arch }}
  49. CROSS_LIB: /usr/${{ matrix.config.triple }}
  50. run: |
  51. $QEMU_EXEC -L . -L $CROSS_LIB/ test/test-float
  52. $QEMU_EXEC -L . -L $CROSS_LIB/ test/test-double