Skip to content

Commit 0f8ceb6

Browse files
frewsxcvemilio
authored andcommitted
Run tests on AArch64
1 parent 43a0565 commit 0f8ceb6

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

.github/workflows/bindgen.yml

+23
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,29 @@ jobs:
149149
BINDGEN_NO_DEFAULT_FEATURES: ${{matrix.no_default_features}}
150150
run: ./ci/test.sh
151151

152+
test_aarch64:
153+
name: "Run tests on AArch64"
154+
runs-on: ubuntu-20.04
155+
steps:
156+
- uses: actions/checkout@v2
157+
- uses: uraimo/[email protected]
158+
name: Run test commands
159+
with:
160+
arch: aarch64
161+
distro: ubuntu20.04
162+
githubToken: ${{ github.token }}
163+
env: |
164+
LLVM_VERSION: "10.0"
165+
dockerRunArgs: |
166+
--volume "${HOME}/.cargo:/root/.cargo"
167+
install: |
168+
apt-get update -q -y
169+
apt-get install -q -y curl gcc git g++ libtinfo5 xz-utils
170+
run: |
171+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
172+
source $HOME/.cargo/env
173+
./ci/test.sh
174+
152175
test-book:
153176
runs-on: ubuntu-latest
154177
steps:

bindgen-integration/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ fn test_macro_customintkind_path() {
261261
}
262262

263263
// https://github.com/rust-lang/rust-bindgen/issues/1973
264+
#[cfg_attr(target_arch = "aarch64", should_panic)] // This line should be removed after the bug linked above is fixed
264265
#[test]
265266
fn test_homogeneous_aggregate_float_union() {
266267
unsafe {

ci/test.sh

+13-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,18 @@ set -x
88
# Give a pipeline a non-zero exit code if one of its constituents fails
99
set -o pipefail
1010

11+
# Set default values on environment variables
12+
BINDGEN_RELEASE_BUILD="${BINDGEN_RELEASE_BUILD:-0}"
13+
BINDGEN_FEATURE_RUNTIME="${BINDGEN_FEATURE_RUNTIME:-0}"
14+
BINDGEN_FEATURE_EXTRA_ASSERTS="${BINDGEN_FEATURE_EXTRA_ASSERTS:-0}"
15+
BINDGEN_FEATURE_TESTING_ONLY_DOCS="${BINDGEN_FEATURE_TESTING_ONLY_DOCS:-0}"
16+
BINDGEN_NO_DEFAULT_FEATURES="${BINDGEN_NO_DEFAULT_FEATURES:-0}"
17+
1118
function llvm_linux_target_triple() {
12-
echo "x86_64-linux-gnu-ubuntu-16.04"
19+
case "$(uname -m)" in
20+
aarch64) echo "aarch64-linux-gnu" ;;
21+
*) echo "x86_64-linux-gnu-ubuntu-16.04" ;;
22+
esac
1323
}
1424

1525
function llvm_macos_target_triple() {
@@ -52,7 +62,7 @@ function llvm_download() {
5262
if [ -d "${LLVM_DIRECTORY}" ]; then
5363
echo "Using cached LLVM download for ${LLVM}..."
5464
else
55-
wget --no-verbose $base_url/${LLVM}.tar.xz
65+
curl -L -o ${LLVM}.tar.xz $base_url/${LLVM}.tar.xz
5666
mkdir -p "${LLVM_DIRECTORY}"
5767
tar xf ${LLVM}.tar.xz -C "${LLVM_DIRECTORY}" --strip-components=1
5868
fi
@@ -66,7 +76,7 @@ set_llvm_env() {
6676
export LLVM_VERSION_TRIPLE=`llvm_version_triple ${LLVM_VERSION}`
6777
local base_url=`llvm_base_url ${LLVM_VERSION_TRIPLE}`
6878

69-
if [ "$GITHUB_ACTIONS_OS" == "ubuntu-latest" ]; then
79+
if [ "$(uname -s)" == "Linux" ]; then
7080
llvm_download $base_url `llvm_linux_target_triple ${LLVM_VERSION_TRIPLE}`
7181
export LD_LIBRARY_PATH="${LLVM_DIRECTORY}/lib":${LD_LIBRARY_PATH:-}
7282
else

0 commit comments

Comments
 (0)