Skip to content

Commit

Permalink
Use setup-cross-toolchain-action instead of cross
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Mar 12, 2023
1 parent e094a1a commit 0daa6ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ jobs:
- rust: nightly
os: ubuntu-latest
target: i686-unknown-linux-gnu
- rust: nightly
os: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
# Test 32-bit target that does not have AtomicU64/AtomicI64.
- rust: nightly
os: ubuntu-latest
Expand All @@ -61,8 +64,9 @@ jobs:
- name: Install Rust
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
- name: Install cross
uses: taiki-e/install-action@cross
- uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
if: matrix.target != ''
- name: Test
run: ./ci/test.sh
Expand Down
6 changes: 3 additions & 3 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..

# shellcheck disable=SC2086
if [[ -n "${RUST_TARGET:-}" ]]; then
# If RUST_TARGET is specified, use cross for testing.
cross test --all --target "$RUST_TARGET" --exclude benchmarks -- --test-threads=1
cross test --all --target "$RUST_TARGET" --exclude benchmarks --release -- --test-threads=1
cargo test --all --target "$RUST_TARGET" --exclude benchmarks ${DOCTEST_XCOMPILE:-} -- --test-threads=1
cargo test --all --target "$RUST_TARGET" --exclude benchmarks --release ${DOCTEST_XCOMPILE:-} -- --test-threads=1

# For now, the non-host target only runs tests.
exit 0
Expand Down

0 comments on commit 0daa6ce

Please sign in to comment.