Skip to content

Commit

Permalink
Add VAES jobs to aes CI
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanshade committed Feb 14, 2024
1 parent a6954fb commit ba10d7f
Showing 1 changed file with 78 additions and 2 deletions.
80 changes: 78 additions & 2 deletions .github/workflows/aes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ defaults:
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"
SDE_FULL_VERSION: "9.33.0-2024-01-07"

jobs:
# Builds for no_std platforms
Expand Down Expand Up @@ -59,7 +60,7 @@ jobs:
minimal-versions:
uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master
with:
working-directory: ${{ github.workflow }}
working-directory: ${{ github.workflow }}

# Tests for the AES-NI backend
aesni:
Expand Down Expand Up @@ -96,6 +97,82 @@ jobs:
- run: cargo test --target ${{ matrix.target }} --features hazmat
- run: cargo test --target ${{ matrix.target }} --all-features

# Tests for the VAES AVX backend
vaes256:
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
rust: nightly-2024-02-13
steps:
- uses: actions/checkout@v4
- uses: silvanshade/rustcrypto-actions/intel-sde-install@master
with:
sde-full-version: ${{ env.SDE_FULL_VERSION }}
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
# NOTE: Write a `.cargo/config.toml` to configure the target for VAES
# NOTE: We use intel-sde as the runner since not all GitHub CI hosts support AVX512
- name: write .cargo/config.toml
shell: bash
run: |
cd ../aes/..
mkdir -p .cargo
echo '[target.${{ matrix.target }}]' > .cargo/config.toml
echo 'runner = "sde64 -icl --"' >> .cargo/config.toml
echo 'rustflags = [' >> .cargo/config.toml
echo ' "-Dwarnings",' >> .cargo/config.toml
echo ' "-C", "target-cpu=icelake-client",' >> .cargo/config.toml
echo ']' >> .cargo/config.toml
- run: ${{ matrix.deps }}
- run: unset RUSTFLAGS && cargo test --target ${{ matrix.target }}
- run: unset RUSTFLAGS && cargo test --target ${{ matrix.target }} --features hazmat
- run: unset RUSTFLAGS && cargo test --target ${{ matrix.target }} --all-features

# Tests for the VAES AVX512 backend
vaes512:
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
rust: nightly-2024-02-13
steps:
- uses: actions/checkout@v4
- uses: silvanshade/rustcrypto-actions/intel-sde-install@master
with:
sde-full-version: ${{ env.SDE_FULL_VERSION }}
- uses: RustCrypto/actions/cargo-cache@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
# NOTE: Write a `.cargo/config.toml` to configure the target for VAES
# NOTE: We use intel-sde as the runner since not all GitHub CI hosts support AVX512
- name: write .cargo/config.toml
shell: bash
run: |
cd ../aes/..
mkdir -p .cargo
echo '[target.${{ matrix.target }}]' > .cargo/config.toml
echo 'runner = "sde64 -icl --"' >> .cargo/config.toml
echo 'rustflags = [' >> .cargo/config.toml
echo ' "-Dwarnings",' >> .cargo/config.toml
echo ' "-C", "target-cpu=icelake-client",' >> .cargo/config.toml
echo ']' >> .cargo/config.toml
- run: ${{ matrix.deps }}
- run: unset RUSTFLAGS && cargo test --target ${{ matrix.target }}
- run: unset RUSTFLAGS && cargo test --target ${{ matrix.target }} --features hazmat
- run: unset RUSTFLAGS && cargo test --target ${{ matrix.target }} --all-features

# Tests for CPU feature autodetection with fallback to portable software implementation
autodetect:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -159,7 +236,6 @@ jobs:
- run: cargo test --target ${{ matrix.target }}
- run: cargo test --target ${{ matrix.target }} --all-features


# Cross-compiled tests
cross:
strategy:
Expand Down

0 comments on commit ba10d7f

Please sign in to comment.