cargo
cargo copied to clipboard
Allow to specify `cross` version
Do the checklist before filing an issue:
- [x] Is this related to the
actions-rs
Actions? If you think it's a problem related to Github Actions in general, use GitHub Community forum instead: https://github.community - [x] You've read the Contributing section about feature requests: https://github.com/actions-rs/.github/blob/master/CONTRIBUTING.md#feature-requests
- [ ] Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.
Motivation
Cross-compilation is super useful, but sadly cross
is sometimes breaking things such as the compilation for powerpc64-unknown-linux-gnu
and it doesn't really do semver when breaking stuff, but still has past versions we could use instead.
This project was already hit once: https://github.com/actions-rs/cargo/commit/4630dea6323d541f7f7e71e3f914aff0f390ae9e
So I propose to be able to tag a cross version in the action.
Workflow example
cross-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust_target:
- powerpc-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
- powerpc64le-unknown-linux-gnu
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
target: ${{ matrix.rust_target }}
default: true
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: v0.1.16
command: build
args: --target ${{ matrix.rust_target }}
- name: Test
uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --target ${{ matrix.rust_target }}
When nothing is specified in the "use-cross" field, it would just use the existing cross
version or download the latest, but if something is specified, it should fetch that version of cross
instead.