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

Add a github action to check cross-compilation from Linux #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/coreaudio-sys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,28 @@ jobs:
- name: cargo doc - all features
run: cargo doc --all-features --verbose

# Check that cross-compilation from linux is working.
# TODO: This is adapted from old travis file, should probably also:
# - Check more feature permutations.
# - Use more recent SDK? Looks like 10.13 is used atm.
# - Check iOS target?
linux-cross-compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Add apple target
run: rustup target add x86_64-apple-darwin
- name: Download SDK
run: curl -sL https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.13.sdk.tar.xz | tar -Jxf -; export COREAUDIO_SDK_PATH="$PWD/MacOSX10.13.sdk"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we feel about maxing this a jobs.<job_id>.strategy.matrix option and having a couple versions of the SDK being tested? One nice thing about linux -> macos cross compilation is that it's easy to get a bunch of SDKs and test against.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

I guess one important thing to note is that if we want to make sure documentation builds successfully, we'll need to be able to recreate the same cross compilation approach (with same version targets etc) that docs.rs use, otherwise there's a chance the docs build will fail despite our CI passing. See rust-lang/docs.rs#853.

- name: Cargo build
run: cargo build --verbose --target=x86_64-apple-darwin

# Publish a new version when pushing to master.
# Will succeed if the version has been updated, otherwise silently fails.
cargo-publish:
Expand Down