Skip to content

Commit

Permalink
CI: test on 64-bit Windows (GNU)
Browse files Browse the repository at this point in the history
Splits the GitHub Actions configs into `linux`, `windows`, and `cross`
jobs, each configured to test certain targets.

Tests Windows in the 64-bit environment only, as it seems it's not
possible to test MINGW32 builds on 64-bit Windows:

rust-lang/rust#33535 (comment)

> The compiler only assumes that it can run executables for its own
> platform, which in this case is x86_64-pc-windows-gnu. That means that
> the compiler is running a 64-bit mingw gcc trying to generate a 32-bit
> executable. The mingw gcc builds, however, do not support this.
  • Loading branch information
tarcieri committed Oct 20, 2020
1 parent 224ecbe commit 642dbf1
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 70 deletions.
46 changes: 32 additions & 14 deletions .github/workflows/md5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,37 @@ on:
push:
branches: master

defaults:
run:
working-directory: md5

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"

jobs:
test:
# Linux tests
linux:
strategy:
matrix:
include:
# 32-bit Linux/x86
- target: i686-unknown-linux-gnu
platform: ubuntu-latest
toolchain: 1.41.0 # MSRV
toolchain: 1.43.0 # MSRV
deps: sudo apt install gcc-multilib
- target: i686-unknown-linux-gnu
platform: ubuntu-latest
toolchain: stable
deps: sudo apt install gcc-multilib

# 64-bit Linux/x86_64
- target: x86_64-unknown-linux-gnu
platform: ubuntu-latest
toolchain: 1.41.0 # MSRV
toolchain: 1.43.0 # MSRV
deps: true
- target: x86_64-unknown-linux-gnu
platform: ubuntu-latest
toolchain: stable
deps: true

runs-on: ${{ matrix.platform }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: ${{ matrix.deps }}
Expand All @@ -47,10 +48,27 @@ jobs:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
override: true
# NOTE: using `marcopolo/cargo` fork to support the `working-directory` attribute
# See: https://github.com/actions-rs/cargo/pull/59
- uses: marcopolo/cargo@master
- run: cargo test --target ${{ matrix.target }} --release

# Windows tests
windows:
strategy:
matrix:
include:
# 64-bit Windows (GNU)
- target: x86_64-pc-windows-gnu
toolchain: 1.43.0 # MSRV
- target: x86_64-pc-windows-gnu
toolchain: stable

runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- uses: msys2/setup-msys2@v2
- uses: actions-rs/toolchain@v1
with:
command: test
working-directory: md5
args: --target ${{ matrix.target }} --release
profile: minimal
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
override: true
- run: cargo test --target ${{ matrix.target }} --release
79 changes: 52 additions & 27 deletions .github/workflows/sha1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,83 @@ on:
push:
branches: master

defaults:
run:
working-directory: sha1

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"

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

# 64-bit Linux/x86_64
- target: x86_64-unknown-linux-gnu
platform: ubuntu-latest
rust: 1.41.0 # MSRV
use_cross: false
rust: 1.43.0 # MSRV
deps: true
- target: x86_64-unknown-linux-gnu
platform: ubuntu-latest
rust: stable
use_cross: false
deps: true

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

# Windows tests
windows:
strategy:
matrix:
include:
# 64-bit Windows (GNU)
- target: x86_64-pc-windows-gnu
toolchain: 1.43.0 # MSRV
- target: x86_64-pc-windows-gnu
toolchain: stable

runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- uses: msys2/setup-msys2@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
override: true
- run: cargo test --target ${{ matrix.target }} --release

# Cross-compiled tests
cross:
strategy:
matrix:
include:
# ARM64
- target: aarch64-unknown-linux-gnu
platform: ubuntu-latest
rust: 1.41.0 # MSRV
use_cross: true
deps: true
rust: 1.43.0 # MSRV
- target: aarch64-unknown-linux-gnu
platform: ubuntu-latest
rust: stable
use_cross: true
deps: true

runs-on: ${{ matrix.platform }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: ${{ matrix.deps }}
Expand All @@ -63,11 +94,5 @@ jobs:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
# NOTE: using `marcopolo/cargo` fork to support the `working-directory` attribute
# See: https://github.com/actions-rs/cargo/pull/59
- uses: marcopolo/cargo@master
with:
command: test
working-directory: sha1
use-cross: ${{ matrix.use_cross }}
args: --target ${{ matrix.target }} --release
- run: cargo install cross
- run: cross test --target ${{ matrix.target }} --release
75 changes: 48 additions & 27 deletions .github/workflows/sha2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,74 @@ env:
RUSTFLAGS: "-Dwarnings"

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

# 64-bit Linux/x86_64
- target: x86_64-unknown-linux-gnu
platform: ubuntu-latest
rust: 1.41.0 # MSRV
use_cross: false
rust: 1.43.0 # MSRV
deps: true
- target: x86_64-unknown-linux-gnu
platform: ubuntu-latest
rust: stable
use_cross: false
deps: true

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

# Windows tests
windows:
strategy:
matrix:
include:
# 64-bit Windows (GNU)
- target: x86_64-pc-windows-gnu
toolchain: 1.43.0 # MSRV
- target: x86_64-pc-windows-gnu
toolchain: stable

runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- uses: msys2/setup-msys2@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
override: true
- run: cargo test --target ${{ matrix.target }} --release

# Cross-compiled tests
cross:
strategy:
matrix:
include:
# ARM64
- target: aarch64-unknown-linux-gnu
platform: ubuntu-latest
rust: 1.41.0 # MSRV
use_cross: true
deps: true
rust: 1.43.0 # MSRV
- target: aarch64-unknown-linux-gnu
platform: ubuntu-latest
rust: stable
use_cross: true
deps: true

runs-on: ${{ matrix.platform }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: ${{ matrix.deps }}
Expand All @@ -67,11 +94,5 @@ jobs:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
# NOTE: using `marcopolo/cargo` fork to support the `working-directory` attribute
# See: https://github.com/actions-rs/cargo/pull/59
- uses: marcopolo/cargo@master
with:
command: test
working-directory: sha1
use-cross: ${{ matrix.use_cross }}
args: --target ${{ matrix.target }} --release
- run: cargo install cross
- run: cross test --target ${{ matrix.target }} --release
2 changes: 1 addition & 1 deletion .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.41.0 # MSRV
toolchain: 1.43.0 # MSRV
components: clippy
override: true
- run: cargo clippy --all -- -D warnings
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RustCrypto: ASM hashes [![Project Chat][chat-image]][chat-link]
# RustCrypto: ASM hashes ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link]

Assembly implementations of hash functions core functionality based on code from
[Project Nayuki](https://www.nayuki.io/).
Expand All @@ -9,6 +9,13 @@ functionality please refer to the crates from
enabled `asm` feature `md5`, `sha-1`, `sha2` and `whirlpool` crates will use
code from this repository.

### Minimum Supported Rust Version

All crates in this repository support **Rust 1.43** or higher.

In the future when the minimum supported Rust version is changed,
it will be accompanied by a minor version bump.

## License

All crates licensed under the [MIT license](http://opensource.org/licenses/MIT).
Expand All @@ -21,5 +28,6 @@ dual licensed as above, without any additional terms or conditions.

[//]: # (badges)

[rustc-image]: https://img.shields.io/badge/rustc-1.43+-blue.svg
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes

0 comments on commit 642dbf1

Please sign in to comment.