From 3b2a7b73b4263d0d2afe4904c55d2161ddcc418a Mon Sep 17 00:00:00 2001 From: Vincent Thiberville Date: Sun, 26 Feb 2023 11:34:12 +0100 Subject: [PATCH] ci: add test on big-endian arch in CI --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ Cross.toml | 7 +++++++ 2 files changed, 41 insertions(+) create mode 100644 Cross.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3ead283..5ae475a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,3 +159,37 @@ jobs: - run: | cd boreal cargo check --all-features + + other-archs: + name: Test other architectures + runs-on: ubuntu-22.04 + env: + CROSS_VERSION: v0.2.5 + steps: + - uses: actions/checkout@v3 + - name: Install and configure Cross + run: | + # Copied from rust-lang/regex CI: + # + dir="$RUNNER_TEMP/cross-download" + mkdir "$dir" + echo "$dir" >> $GITHUB_PATH + cd "$dir" + curl -LO "https://github.com/cross-rs/cross/releases/download/$CROSS_VERSION/cross-x86_64-unknown-linux-musl.tar.gz" + tar xf cross-x86_64-unknown-linux-musl.tar.gz + echo "CARGO=cross" >> $GITHUB_ENV + echo "TARGET=--target ${{ matrix.target }}" >> $GITHUB_ENV + - name: Run tests + run: cross test --target ${{ matrix.target }} + - name: Run tests with authenticode feature + run: cross test --target ${{ matrix.target }} --features authenticode + + strategy: + fail-fast: false + matrix: + build: [s390x, aarch64] + include: + - build: s390x + target: s390x-unknown-linux-gnu + - build: aarch64 + target: aarch64-unknown-linux-gnu diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 00000000..3d02cf65 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,7 @@ +[build] +pre-build = [ + "dpkg --add-architecture $CROSS_DEB_ARCH", + "apt-get update", + "apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH", + "apt-get install --assume-yes --no-install-recommends libclang-10-dev clang-10" +]