| 1 |
name: Rust |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [ master, dev ] |
| 6 |
pull_request: |
| 7 |
branches: [ master, dev ] |
| 8 |
|
| 9 |
jobs: |
| 10 |
ubuntu: |
| 11 |
runs-on: ubuntu-latest |
| 12 |
name: test on ubuntu |
| 13 |
timeout-minutes: 30 |
| 14 |
|
| 15 |
steps: |
| 16 |
- uses: actions/checkout@v2 |
| 17 |
- name: Cache Cargo Dependencies |
| 18 |
uses: Swatinem/[email protected] |
| 19 |
- name: Build without default features |
| 20 |
run: cargo build --no-default-features --verbose |
| 21 |
- name: Run tests without default features |
| 22 |
run: cargo test --no-default-features --verbose |
| 23 |
- name: Build with rayon feature |
| 24 |
run: cargo build --features rayon --verbose |
| 25 |
- name: Run tests with rayon feature |
| 26 |
run: cargo test --features rayon --verbose |
| 27 |
|
| 28 |
|
| 29 |
macos: |
| 30 |
runs-on: macos-latest |
| 31 |
name: test on mac os |
| 32 |
timeout-minutes: 30 |
| 33 |
|
| 34 |
steps: |
| 35 |
- uses: actions/checkout@v2 |
| 36 |
- name: Cache Cargo Dependencies |
| 37 |
uses: Swatinem/[email protected] |
| 38 |
- name: Build without default features |
| 39 |
run: cargo build --no-default-features --verbose |
| 40 |
- name: Run tests without default features |
| 41 |
run: cargo test --no-default-features --verbose |
| 42 |
- name: Build with rayon feature |
| 43 |
run: cargo build --features rayon --verbose |
| 44 |
- name: Run tests with rayon feature |
| 45 |
run: cargo test --features rayon --verbose |
| 46 |
|
| 47 |
verify-msrv: |
| 48 |
strategy: |
| 49 |
matrix: |
| 50 |
os: [ubuntu-latest] |
| 51 |
runs-on: ${{ matrix.os }} |
| 52 |
name: verify minimum supported rust version without cache (takes longer, but caching produces unexpected behaviour) |
| 53 |
timeout-minutes: 30 |
| 54 |
|
| 55 |
# we are using the `cargo-msrv` app |
| 56 |
# https://github.com/foresterre/cargo-msrv |
| 57 |
|
| 58 |
steps: |
| 59 |
- uses: actions/checkout@v2 |
| 60 |
|
| 61 |
- name: Install foresterre/cargo-msrv |
| 62 |
run: cargo install cargo-msrv |
| 63 |
|
| 64 |
- uses: dtolnay/rust-toolchain@nightly |
| 65 |
- name: Generate Cargo.lock with minimal-version dependencies |
| 66 |
run: cargo -Zminimal-versions generate-lockfile |
| 67 |
|
| 68 |
- name: Verify the Rustc version declared in `Cargo.toml` with `minimal-versions` |
| 69 |
run: cargo-msrv verify |
| 70 |
|
| 71 |
# github actions does not support big endian systems directly, but it does support QEMU. |
| 72 |
# so we use cross-rs, which uses QEMU internally. |
| 73 |
big-endian: |
| 74 |
runs-on: ubuntu-latest |
| 75 |
name: test on emulated big endian system |
| 76 |
timeout-minutes: 90 # todo just make tests faster wtf |
| 77 |
|
| 78 |
# we are using the cross project for cross compilation: |
| 79 |
# https://github.com/cross-rs/cross |
| 80 |
|
| 81 |
steps: |
| 82 |
- uses: actions/checkout@v2 |
| 83 |
|
| 84 |
- name: Install or use cached cross-rs/cross |
| 85 |
uses: baptiste0928/cargo-install@v1 |
| 86 |
with: |
| 87 |
crate: cross |
| 88 |
|
| 89 |
- name: Cache Cargo Dependencies |
| 90 |
uses: Swatinem/[email protected] |
| 91 |
|
| 92 |
- name: Start Docker |
| 93 |
run: sudo systemctl start docker |
| 94 |
|
| 95 |
# https://github.com/cross-rs/cross#supported-targets |
| 96 |
- name: Cross-Compile project to powerpc-unknown-linux-gnu without rayon feature |
| 97 |
run: cross build --target powerpc-unknown-linux-gnu --no-default-features --verbose |
| 98 |
|
| 99 |
- name: Cross-Run Tests in powerpc-unknown-linux-gnu without rayon feature |
| 100 |
run: cross test --target powerpc-unknown-linux-gnu --no-default-features --verbose |
| 101 |
|
| 102 |
- name: Cross-Compile project to powerpc-unknown-linux-gnu with rayon feature |
| 103 |
run: cross build --target powerpc-unknown-linux-gnu --features rayon --verbose |
| 104 |
|
| 105 |
- name: Cross-Run Tests in powerpc-unknown-linux-gnu with rayon feature |
| 106 |
run: cross test --target powerpc-unknown-linux-gnu --features rayon --verbose |
| 107 |
|
| 108 |
wasm32: |
| 109 |
runs-on: ubuntu-latest |
| 110 |
name: test on wasm32 |
| 111 |
timeout-minutes: 60 |
| 112 |
|
| 113 |
steps: |
| 114 |
- uses: actions/checkout@v2 |
| 115 |
|
| 116 |
- name: Cache Cargo Dependencies |
| 117 |
uses: Swatinem/[email protected] |
| 118 |
|
| 119 |
- name: Add wasm32 Target |
| 120 |
run: rustup target add wasm32-unknown-unknown |
| 121 |
|
| 122 |
- name: Build without default features |
| 123 |
run: cargo build --verbose --no-default-features --target wasm32-unknown-unknown |
| 124 |
|
| 125 |
- name: Run tests without default features |
| 126 |
run: cargo test --verbose --no-default-features |
| 127 |
|