From 9d4d974622a3e0709dc06f3ef694bd28b568a0b0 Mon Sep 17 00:00:00 2001 From: Zhang Jingqiang Date: Mon, 23 Dec 2024 11:36:54 +0800 Subject: [PATCH] use debian container to run cross compiling and add loongarch64 --- .github/workflows/cross.yml | 38 +++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cross.yml b/.github/workflows/cross.yml index b50bdf2da..753e1af6b 100644 --- a/.github/workflows/cross.yml +++ b/.github/workflows/cross.yml @@ -15,22 +15,24 @@ on: - 'master' - 'lts/**' -env: - CARGO_TERM_COLOR: always - CROSS_FEATURES: --no-default-features --features vendored-openssl,rustls-ring,quic,vendored-c-ares,hickory - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc - CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER: riscv64-linux-gnu-gcc - CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER: powerpc64le-linux-gnu-gcc - CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER: s390x-linux-gnu-gcc - CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc - CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc - CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER: arm-linux-gnueabi-gcc - CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER: i686-linux-gnu-gcc - jobs: build: name: Build runs-on: ubuntu-latest + container: + image: debian:sid + env: + CARGO_TERM_COLOR: always + CROSS_FEATURES: --no-default-features --features vendored-openssl,rustls-ring,quic,vendored-c-ares,hickory + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc + CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER: riscv64-linux-gnu-gcc + CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER: powerpc64le-linux-gnu-gcc + CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER: s390x-linux-gnu-gcc + CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER: loongarch64-linux-gnu-gcc + CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc + CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc + CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER: arm-linux-gnueabi-gcc + CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER: i686-linux-gnu-gcc strategy: matrix: target: [ @@ -70,8 +72,16 @@ jobs: rustc: s390x-unknown-linux-gnu, gcc: gcc-s390x-linux-gnu, }, + { + rustc: loongarch64-unknown-linux-gnu, + gcc: gcc-loongarch64-linux-gnu, + }, ] steps: + - name: Install tools + run: | + apt-get -y update + apt-get -y install git curl gcc make pkgconf cmake - name: Checkout sources uses: actions/checkout@v4 with: @@ -80,10 +90,10 @@ jobs: uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target.rustc }} + components: clippy - name: Install dependencies run: | - sudo apt-get update - sudo apt-get install capnproto ${{ matrix.target.gcc }} + apt-get -y install capnproto ${{ matrix.target.gcc }} - name: Cargo build run: cargo build --target=${{ matrix.target.rustc }} $CROSS_FEATURES - name: Cargo clippy