Skip to content

Commit

Permalink
Run tests on AArch64
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv authored and emilio committed Feb 4, 2021
1 parent 43a0565 commit 0f8ceb6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/bindgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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:
Expand Down
1 change: 1 addition & 0 deletions bindgen-integration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 13 additions & 3 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0f8ceb6

Please sign in to comment.