summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2021-01-31 16:34:27 -0500
committerEmilio Cobos Álvarez <emilio@crisal.io>2021-02-04 16:46:38 +0100
commit0f8ceb68fd16e2b2a6c95a0e919dff4989cd0dec (patch)
tree2a899bf93d1d51d2ac923f5e5d5b7da65f760488
parent43a05656ae1949a59d95fb62300df1d0ee76de39 (diff)
Run tests on AArch64
-rw-r--r--.github/workflows/bindgen.yml23
-rwxr-xr-xbindgen-integration/src/lib.rs1
-rwxr-xr-xci/test.sh16
3 files changed, 37 insertions, 3 deletions
diff --git a/.github/workflows/bindgen.yml b/.github/workflows/bindgen.yml
index 9aa09075..0a340bad 100644
--- a/.github/workflows/bindgen.yml
+++ b/.github/workflows/bindgen.yml
@@ -149,6 +149,29 @@ jobs:
BINDGEN_NO_DEFAULT_FEATURES: ${{matrix.no_default_features}}
run: ./ci/test.sh
+ test_aarch64:
+ name: "Run tests on AArch64"
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v2
+ - uses: uraimo/run-on-arch-action@v2.0.8
+ name: Run test commands
+ with:
+ arch: aarch64
+ distro: ubuntu20.04
+ githubToken: ${{ github.token }}
+ env: |
+ LLVM_VERSION: "10.0"
+ dockerRunArgs: |
+ --volume "${HOME}/.cargo:/root/.cargo"
+ install: |
+ apt-get update -q -y
+ apt-get install -q -y curl gcc git g++ libtinfo5 xz-utils
+ run: |
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
+ source $HOME/.cargo/env
+ ./ci/test.sh
+
test-book:
runs-on: ubuntu-latest
steps:
diff --git a/bindgen-integration/src/lib.rs b/bindgen-integration/src/lib.rs
index c145d895..0d698961 100755
--- a/bindgen-integration/src/lib.rs
+++ b/bindgen-integration/src/lib.rs
@@ -261,6 +261,7 @@ fn test_macro_customintkind_path() {
}
// https://github.com/rust-lang/rust-bindgen/issues/1973
+#[cfg_attr(target_arch = "aarch64", should_panic)] // This line should be removed after the bug linked above is fixed
#[test]
fn test_homogeneous_aggregate_float_union() {
unsafe {
diff --git a/ci/test.sh b/ci/test.sh
index d5bb0bf4..cc834755 100755
--- a/ci/test.sh
+++ b/ci/test.sh
@@ -8,8 +8,18 @@ set -x
# Give a pipeline a non-zero exit code if one of its constituents fails
set -o pipefail
+# Set default values on environment variables
+BINDGEN_RELEASE_BUILD="${BINDGEN_RELEASE_BUILD:-0}"
+BINDGEN_FEATURE_RUNTIME="${BINDGEN_FEATURE_RUNTIME:-0}"
+BINDGEN_FEATURE_EXTRA_ASSERTS="${BINDGEN_FEATURE_EXTRA_ASSERTS:-0}"
+BINDGEN_FEATURE_TESTING_ONLY_DOCS="${BINDGEN_FEATURE_TESTING_ONLY_DOCS:-0}"
+BINDGEN_NO_DEFAULT_FEATURES="${BINDGEN_NO_DEFAULT_FEATURES:-0}"
+
function llvm_linux_target_triple() {
- echo "x86_64-linux-gnu-ubuntu-16.04"
+ case "$(uname -m)" in
+ aarch64) echo "aarch64-linux-gnu" ;;
+ *) echo "x86_64-linux-gnu-ubuntu-16.04" ;;
+ esac
}
function llvm_macos_target_triple() {
@@ -52,7 +62,7 @@ function llvm_download() {
if [ -d "${LLVM_DIRECTORY}" ]; then
echo "Using cached LLVM download for ${LLVM}..."
else
- wget --no-verbose $base_url/${LLVM}.tar.xz
+ curl -L -o ${LLVM}.tar.xz $base_url/${LLVM}.tar.xz
mkdir -p "${LLVM_DIRECTORY}"
tar xf ${LLVM}.tar.xz -C "${LLVM_DIRECTORY}" --strip-components=1
fi
@@ -66,7 +76,7 @@ set_llvm_env() {
export LLVM_VERSION_TRIPLE=`llvm_version_triple ${LLVM_VERSION}`
local base_url=`llvm_base_url ${LLVM_VERSION_TRIPLE}`
- if [ "$GITHUB_ACTIONS_OS" == "ubuntu-latest" ]; then
+ if [ "$(uname -s)" == "Linux" ]; then
llvm_download $base_url `llvm_linux_target_triple ${LLVM_VERSION_TRIPLE}`
export LD_LIBRARY_PATH="${LLVM_DIRECTORY}/lib":${LD_LIBRARY_PATH:-}
else