Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Run tests on aarch64-apple-darwin and aarch64-apple-ios-sim. #398

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 33 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
cargo generate-lockfile -Z minimal-versions
cargo test --features=custom,std

# TODO: add aarch64-based macOS runner when it's supported by Github Actions
main-tests:
name: Tier 1 Test
runs-on: ${{ matrix.os }}
Expand All @@ -48,8 +47,12 @@ jobs:
toolchain: [nightly, beta, stable, 1.36]
# Only Test macOS on stable to reduce macOS CI jobs
include:
# x86_64-apple-darwin.
- os: macos-12
toolchain: stable
# aarch64-apple-darwin.
- os: macos-14
toolchain: stable
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
Expand Down Expand Up @@ -84,18 +87,43 @@ jobs:

ios-tests:
name: iOS Simulator Test
runs-on: macos-12
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12, macos-14]
# Only test on stable to reduce macOS CI jobs
toolchain: [stable]
include:
# The Aarch64 device simulator doesn't seem to work on an x86-64 host
# and the x86_64 device simulator doesn't seem to work on an Aarch64
# host, at least within GitHub Actions.
- os: macos-12
target: x86_64-apple-ios
ios_platform: auto-ios-x86_64
- os: macos-14
target: aarch64-apple-ios-sim
ios_platform: auto-ios-aarch64-sim
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-ios
targets: ${{ matrix.target }}
# There is no precompiled cargo-dinghy for Aarch64. The precompiled
# x86_64 binary runs on ARM64 macOS via Rosetta 2, but it fails to
# correctly interface with macOS toolchain.
- name: Install precompiled cargo-dinghy
if: ${{ matrix.target == 'x86_64-apple-ios' }}
run: |
VERSION=0.6.2
URL="https://github.com/sonos/dinghy/releases/download/${VERSION}/cargo-dinghy-macos-${VERSION}.tgz"
wget -O - $URL | tar -xz --strip-components=1 -C ~/.cargo/bin
cargo dinghy --version
- name: cargo install cargo-dinghy
if: ${{ matrix.target == 'aarch64-apple-ios-sim' }}
run: |
VERSION=0.6.2
cargo install cargo-dinghy --version ${VERSION}
- name: Check cargo-dinghy version.
run: cargo dinghy --version
- name: Setup Simulator
# Use the first installed iOS runtime and the first (i.e. oldest) supported iPhone device.
run: |
Expand All @@ -110,7 +138,7 @@ jobs:
echo "device=$SIM_ID" >> $GITHUB_ENV
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo dinghy -d ${{ env.device }} test
run: cargo dinghy -p ${{ matrix.ios_platform }} -d ${{ env.device }} test

windows-tests:
name: Windows Test
Expand Down
1 change: 0 additions & 1 deletion src/error_impls.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
extern crate std;

use crate::Error;
use core::convert::From;
use std::io;

impl From<Error> for io::Error {
Expand Down