From 3738f08117c0d00e6cc63ac5e8cb87942fe0debc Mon Sep 17 00:00:00 2001 From: Alexander Wagner Date: Thu, 16 Dec 2021 17:06:43 +0100 Subject: [PATCH] WIP Add cross tests --- .github/workflows/blake2.yml | 33 +++++++++++++++++++ .github/workflows/fsb.yml | 33 +++++++++++++++++++ .github/workflows/gost94.yml | 33 +++++++++++++++++++ .github/workflows/groestl.yml | 33 +++++++++++++++++++ .github/workflows/k12.yml | 33 +++++++++++++++++++ .github/workflows/md2.yml | 33 +++++++++++++++++++ .github/workflows/md4.yml | 33 +++++++++++++++++++ .github/workflows/md5.yml | 33 +++++++++++++++++++ .github/workflows/ripemd.yml | 33 +++++++++++++++++++ .github/workflows/sha1.yml | 57 +++++++++++++++++++-------------- .github/workflows/sha2.yml | 13 ++++---- .github/workflows/sha3.yml | 33 +++++++++++++++++++ .github/workflows/shabal.yml | 33 +++++++++++++++++++ .github/workflows/sm3.yml | 33 +++++++++++++++++++ .github/workflows/streebog.yml | 33 +++++++++++++++++++ .github/workflows/tiger.yml | 33 +++++++++++++++++++ .github/workflows/whirlpool.yml | 33 +++++++++++++++++++ 17 files changed, 535 insertions(+), 30 deletions(-) diff --git a/.github/workflows/blake2.yml b/.github/workflows/blake2.yml index 51f49050a..9e8633f3b 100644 --- a/.github/workflows/blake2.yml +++ b/.github/workflows/blake2.yml @@ -3,6 +3,7 @@ name: blake2 on: pull_request: paths: + - ".github/workflows/blake2.yml" - "blake2/**" - "Cargo.*" push: @@ -65,3 +66,35 @@ jobs: - run: cargo test --features simd - run: cargo test --features simd_opt - run: cargo test --features simd_asm + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package blake2 --target ${{ matrix.target }} diff --git a/.github/workflows/fsb.yml b/.github/workflows/fsb.yml index 3a1b1a51d..a0894ffb8 100644 --- a/.github/workflows/fsb.yml +++ b/.github/workflows/fsb.yml @@ -3,6 +3,7 @@ name: fsb on: pull_request: paths: + - ".github/workflows/fsb.yml" - "fsb/**" - "Cargo.*" push: @@ -55,3 +56,35 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package fsb --target ${{ matrix.target }} diff --git a/.github/workflows/gost94.yml b/.github/workflows/gost94.yml index 99c2a8feb..35a7ed659 100644 --- a/.github/workflows/gost94.yml +++ b/.github/workflows/gost94.yml @@ -3,6 +3,7 @@ name: gost94 on: pull_request: paths: + - ".github/workflows/gost94.yml" - "gost94/**" - "Cargo.*" push: @@ -55,3 +56,35 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package gost94 --target ${{ matrix.target }} diff --git a/.github/workflows/groestl.yml b/.github/workflows/groestl.yml index 481e69718..79df55215 100644 --- a/.github/workflows/groestl.yml +++ b/.github/workflows/groestl.yml @@ -3,6 +3,7 @@ name: groestl on: pull_request: paths: + - ".github/workflows/groestl.yml" - "groestl/**" - "Cargo.*" push: @@ -55,3 +56,35 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package groestl --target ${{ matrix.target }} diff --git a/.github/workflows/k12.yml b/.github/workflows/k12.yml index 5899fa6fd..54c138fe0 100644 --- a/.github/workflows/k12.yml +++ b/.github/workflows/k12.yml @@ -3,6 +3,7 @@ name: k12 on: pull_request: paths: + - ".github/workflows/k12.yml" - "k12/**" - "Cargo.*" push: @@ -55,3 +56,35 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package k12 --target ${{ matrix.target }} diff --git a/.github/workflows/md2.yml b/.github/workflows/md2.yml index 26a2cf675..5eb3edabe 100644 --- a/.github/workflows/md2.yml +++ b/.github/workflows/md2.yml @@ -3,6 +3,7 @@ name: md2 on: pull_request: paths: + - ".github/workflows/md2.yml" - "md2/**" - "Cargo.*" push: @@ -55,3 +56,35 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package md2 --target ${{ matrix.target }} diff --git a/.github/workflows/md4.yml b/.github/workflows/md4.yml index 84a15538f..7440fa7e3 100644 --- a/.github/workflows/md4.yml +++ b/.github/workflows/md4.yml @@ -3,6 +3,7 @@ name: md4 on: pull_request: paths: + - ".github/workflows/md4.yml" - "md4/**" - "Cargo.*" push: @@ -55,3 +56,35 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package md4 --target ${{ matrix.target }} diff --git a/.github/workflows/md5.yml b/.github/workflows/md5.yml index 86cab99c2..88bd9b891 100644 --- a/.github/workflows/md5.yml +++ b/.github/workflows/md5.yml @@ -3,6 +3,7 @@ name: md5 on: pull_request: paths: + - ".github/workflows/md5.yml" - "md5/**" - "Cargo.*" push: @@ -58,3 +59,35 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --features asm + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package md5 --target ${{ matrix.target }} diff --git a/.github/workflows/ripemd.yml b/.github/workflows/ripemd.yml index 4168cc285..ba5f7c57e 100644 --- a/.github/workflows/ripemd.yml +++ b/.github/workflows/ripemd.yml @@ -3,6 +3,7 @@ name: ripemd on: pull_request: paths: + - ".github/workflows/ripemd.yml" - "ripemd/**" - "Cargo.*" push: @@ -55,3 +56,35 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package ripemd --target ${{ matrix.target }} diff --git a/.github/workflows/sha1.yml b/.github/workflows/sha1.yml index 2b5960946..5d1effc57 100644 --- a/.github/workflows/sha1.yml +++ b/.github/workflows/sha1.yml @@ -3,6 +3,7 @@ name: sha1 on: pull_request: paths: + - ".github/workflows/sha1.yml" - "sha1/**" - "Cargo.*" push: @@ -122,27 +123,35 @@ jobs: # Cross-compiled tests # *** NOTE: Currently broken with `asm` feature enabled! See: - # https://github.com/RustCrypto/hashes/issues/251 - # - # cross: - # strategy: - # matrix: - # include: - # # ARM64 - # - target: aarch64-unknown-linux-gnu - # rust: 1.41.0 # MSRV - # - target: aarch64-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: cargo install cross - # - run: cross test --target ${{ matrix.target }} - # - run: cross test --target ${{ matrix.target }} --features asm + # https://github.com/RustCrypto/hashes/issues/25 + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package sha1 --target ${{ matrix.target }} + # - run: cross test --package sha1 --target ${{ matrix.target }} --features asm diff --git a/.github/workflows/sha2.yml b/.github/workflows/sha2.yml index 6b2227292..d053d552a 100644 --- a/.github/workflows/sha2.yml +++ b/.github/workflows/sha2.yml @@ -3,6 +3,7 @@ name: sha2 on: pull_request: paths: + - ".github/workflows/sha2.yml" - "sha2/**" - "Cargo.*" push: @@ -121,12 +122,12 @@ jobs: cross: strategy: matrix: - include: - # ARM64 - #- target: aarch64-unknown-linux-gnu - # rust: 1.41.0 # MSRV - - target: aarch64-unknown-linux-gnu - rust: stable + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu runs-on: ubuntu-latest defaults: diff --git a/.github/workflows/sha3.yml b/.github/workflows/sha3.yml index 6e9c9dd1d..b4b3a66e0 100644 --- a/.github/workflows/sha3.yml +++ b/.github/workflows/sha3.yml @@ -3,6 +3,7 @@ name: sha3 on: pull_request: paths: + - ".github/workflows/sha3.yml" - "sha3/**" - "Cargo.*" push: @@ -55,3 +56,35 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package sha3 --target ${{ matrix.target }} diff --git a/.github/workflows/shabal.yml b/.github/workflows/shabal.yml index dfb7f5867..14e14d4f8 100644 --- a/.github/workflows/shabal.yml +++ b/.github/workflows/shabal.yml @@ -3,6 +3,7 @@ name: shabal on: pull_request: paths: + - ".github/workflows/shabal.yml" - "shabal/**" - "Cargo.*" push: @@ -55,3 +56,35 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package shabal --target ${{ matrix.target }} diff --git a/.github/workflows/sm3.yml b/.github/workflows/sm3.yml index 8f353134f..bdc64927f 100644 --- a/.github/workflows/sm3.yml +++ b/.github/workflows/sm3.yml @@ -3,6 +3,7 @@ name: sm3 on: pull_request: paths: + - ".github/workflows/sm3.yml" - "sm3/**" - "Cargo.*" push: @@ -55,3 +56,35 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package sm3 --target ${{ matrix.target }} diff --git a/.github/workflows/streebog.yml b/.github/workflows/streebog.yml index 46f00fd50..b8aefa4af 100644 --- a/.github/workflows/streebog.yml +++ b/.github/workflows/streebog.yml @@ -3,6 +3,7 @@ name: streebog on: pull_request: paths: + - ".github/workflows/streebog.yml" - "streebog/**" - "Cargo.*" push: @@ -55,3 +56,35 @@ jobs: - run: cargo test --no-default-features - run: cargo test - run: cargo test --all-features + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package streebog --target ${{ matrix.target }} diff --git a/.github/workflows/tiger.yml b/.github/workflows/tiger.yml index 273078bf8..c55feb9be 100644 --- a/.github/workflows/tiger.yml +++ b/.github/workflows/tiger.yml @@ -3,6 +3,7 @@ name: tiger on: pull_request: paths: + - ".github/workflows/tiger.yml" - "tiger/**" - "Cargo.*" push: @@ -57,3 +58,35 @@ jobs: - run: cargo check - run: cargo test --no-default-features - run: cargo test + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package tiger --target ${{ matrix.target }} diff --git a/.github/workflows/whirlpool.yml b/.github/workflows/whirlpool.yml index fd506d74c..6716a5b52 100644 --- a/.github/workflows/whirlpool.yml +++ b/.github/workflows/whirlpool.yml @@ -3,6 +3,7 @@ name: whirlpool on: pull_request: paths: + - ".github/workflows/whirlpool.yml" - "whirlpool/**" - "Cargo.*" push: @@ -56,3 +57,35 @@ jobs: - run: cargo test - run: cargo test --features asm - run: cargo test --all-features + + # Cross-compiled tests + cross: + strategy: + matrix: + rust: + - 1.41.0 # MSRV + - stable + target: + - aarch64-unknown-linux-gnu + - mips-unknown-linux-gnu + + runs-on: ubuntu-latest + defaults: + run: + # Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml + working-directory: . + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - name: Install precompiled cross + run: | + export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url') + wget -O /tmp/binaries.tar.gz $URL + tar -C /tmp -xzf /tmp/binaries.tar.gz + mv /tmp/cross ~/.cargo/bin + - run: cross test --package whirlpool --target ${{ matrix.target }}