Skip to content

Commit

Permalink
Build for thumbv7em-none-eabihf as a no_std target to check that buil…
Browse files Browse the repository at this point in the history
…d succeed without std support
  • Loading branch information
DrTobe committed Jul 20, 2023
1 parent 4e8143e commit 9665d52
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
- rust: stable
target: x86_64-fortanix-unknown-sgx
os: ubuntu-20.04
- rust: stable
target: thumbv7em-none-eabihf
os: ubuntu-20.04
- rust: beta
target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
Expand All @@ -48,12 +51,18 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install dependencies
- name: Install qemu for aarch64-unknown-linux-musl
if: matrix.target == 'aarch64-unknown-linux-musl'
run: |
sudo apt-get update
sudo apt-get install -y qemu-user
- name: Install arm-none-eabi-gcc toolchain for thumbv7em-none-eabihf
if: matrix.target == 'thumbv7em-none-eabihf'
run: |
sudo apt-get update
sudo apt-get install -y gcc-arm-none-eabi
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down
13 changes: 8 additions & 5 deletions ct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ if [ "$TRAVIS_RUST_VERSION" == "stable" ] || [ "$TRAVIS_RUST_VERSION" == "beta"
rustup target add --toolchain $TRAVIS_RUST_VERSION $TARGET
printenv

# The SGX target cannot be run under test like a ELF binary
if [ "$TARGET" != "x86_64-fortanix-unknown-sgx" ]; then
if [ "$TARGET" == "x86_64-fortanix-unknown-sgx" ]; then
# The SGX target cannot be run under test like a ELF binary
cargo +$TRAVIS_RUST_VERSION test --no-run --target=$TARGET
cargo +$TRAVIS_RUST_VERSION test --no-default-features --features dsa,force_aesni_support,mpi_force_c_code,rdrand,std,time,tls13 --no-run --target=$TARGET
elif [ "$TARGET" == "thumbv7em-none-eabihf" ]; then
# thumbv7em-none-eabihf is a no_std target, the tests can not be run, we can only check that it builds successfully
cargo build --no-default-features --features no_std_deps --target $TARGET
else
# make sure that explicitly providing the default target works
cargo nextest run --target $TARGET --release
cargo nextest run --features dsa --target $TARGET
Expand All @@ -107,9 +113,6 @@ if [ "$TRAVIS_RUST_VERSION" == "stable" ] || [ "$TRAVIS_RUST_VERSION" == "beta"
if [ "$TARGET" == "x86_64-apple-darwin" ]; then
cargo nextest run --no-default-features --features no_std_deps --target $TARGET
fi
else
cargo +$TRAVIS_RUST_VERSION test --no-run --target=$TARGET
cargo +$TRAVIS_RUST_VERSION test --no-default-features --features dsa,force_aesni_support,mpi_force_c_code,rdrand,std,time,tls13 --no-run --target=$TARGET
fi

else
Expand Down

0 comments on commit 9665d52

Please sign in to comment.