Skip to content

Commit

Permalink
Merge #801
Browse files Browse the repository at this point in the history
801: Use setup-cross-toolchain-action instead of cross r=taiki-e a=taiki-e

[setup-cross-toolchain-action](https://github.com/taiki-e/setup-cross-toolchain-action) is a GitHub Action to set up CI environment for cross-testing, including doctest, without dockers.

This also enables tests for armv7hf on CI.


Co-authored-by: Taiki Endo <te316e89@gmail.com>
  • Loading branch information
bors[bot] and taiki-e committed Mar 12, 2023
2 parents e094a1a + 3d93d7a commit 214c58d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
# Test crates on their minimum Rust versions and nightly Rust.
test:
Expand All @@ -51,6 +55,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 +68,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 214c58d

Please sign in to comment.