Skip to content

Commit

Permalink
sha2: test builds on 32-bit Linux and macOS/x86-64 (#208)
Browse files Browse the repository at this point in the history
Per #207 it seems we aren't doing enough testing, particularly for the
`asm` feature on various platforms.

This commit adds much more extensive testing for the `sha2` crate in
particular, since it's one of the most important.
  • Loading branch information
tarcieri committed Nov 25, 2020
1 parent 78f00c5 commit 58b1362
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 13 deletions.
49 changes: 43 additions & 6 deletions .github/workflows/sha2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ env:
RUSTFLAGS: "-Dwarnings"

jobs:
# Builds for no_std platforms
build:
runs-on: ubuntu-latest
strategy:
Expand All @@ -37,20 +38,56 @@ jobs:
override: true
- run: cargo build --no-default-features --release --target ${{ matrix.target }}

test:
# Linux tests
linux:
strategy:
matrix:
include:
# 32-bit Linux/x86
- target: i686-unknown-linux-gnu
rust: 1.41.0 # MSRV
deps: sudo apt install gcc-multilib
- target: i686-unknown-linux-gnu
rust: stable
deps: sudo apt install gcc-multilib

# 64-bit Linux/x86_64
- target: x86_64-unknown-linux-gnu
rust: 1.41.0 # MSRV
- target: x86_64-unknown-linux-gnu
rust: stable

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- run: ${{ matrix.deps }}
- run: cargo test --target ${{ matrix.target }} --release --no-default-features
- run: cargo test --target ${{ matrix.target }} --release
- run: cargo test --target ${{ matrix.target }} --release --features asm

# macOS tests
macos:
strategy:
matrix:
rust:
toolchain:
- 1.41.0 # MSRV
- stable

runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
toolchain: ${{ matrix.toolchain }}
target: x86_64-apple-darwin
override: true
- run: cargo test --no-default-features
- run: cargo test
- run: cargo test --features asm
- run: cargo test --release --no-default-features
- run: cargo test --release
- run: cargo test --release --features asm
10 changes: 3 additions & 7 deletions sha2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ hex-literal = "0.2"
default = ["std"]
std = ["digest/std"]
asm = ["sha2-asm", "libc"]
# Expose compress function
compress = []
# Force software implementation
force-soft = []

# DEPRECATED: use `asm` instead
asm-aarch64 = ["asm"]
compress = [] # Expose compress function
force-soft = [] # Force software implementation
asm-aarch64 = ["asm"] # DEPRECATED: use `asm` instead

0 comments on commit 58b1362

Please sign in to comment.