Skip to content

Commit

Permalink
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 a977119
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/actions/cross-tests/action.yml
@@ -0,0 +1,32 @@
name: "cross-tests"
description: "tests for aarch64 & mips"

inputs:
rust:
required: true
package:
required: true
target:
required: true
features:
required: true

runs:
using: "composite"
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ inputs.rust }}
target: ${{ inputs.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
shell: bash
- run: cross test --no-default-features --package ${{ inputs.package }} --target ${{ inputs.target }} --features ${{ inputs.features }}
shell: bash
28 changes: 28 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,30 @@ 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
features:
- default

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: ./.github/actions/cross-tests
with:
rust: ${{ matrix.rust }}
package: sha3
target: ${{ matrix.target }}
features: ${{ matrix.features }}

0 comments on commit a977119

Please sign in to comment.