Skip to content

Commit

Permalink
WIP sha3: Add cross tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aewag committed Dec 16, 2021
1 parent cbd6849 commit bdf4ee4
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/sha2.yml
Expand Up @@ -3,6 +3,7 @@ name: sha2
on:
pull_request:
paths:
- ".github/workflows/sha2.yml"
- "sha2/**"
- "Cargo.*"
push:
Expand Down Expand Up @@ -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:
- stable
target:
- aarch64-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- mips-unknown-linux-gnu

runs-on: ubuntu-latest
defaults:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/sha3.yml
Expand Up @@ -3,6 +3,7 @@ name: sha3
on:
pull_request:
paths:
- ".github/workflows/sha3.yml"
- "sha3/**"
- "Cargo.*"
push:
Expand Down Expand Up @@ -55,3 +56,36 @@ 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
- stable
target:
- aarch64-unknown-linux-gnu
- riscv64gc-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 }}

0 comments on commit bdf4ee4

Please sign in to comment.