|
| 1 | +on: [push, pull_request] |
| 2 | + |
| 3 | +name: Pull Request |
| 4 | + |
| 5 | +jobs: |
| 6 | + build_test: |
| 7 | + name: Build and Test Wrapper |
| 8 | + runs-on: ubuntu-18.04 |
| 9 | + env: |
| 10 | + AF_VER: 3.6.4 |
| 11 | + steps: |
| 12 | + - name: Checkout Repository |
| 13 | + uses: actions/checkout@master |
| 14 | + |
| 15 | + - name: Setup Rust Toolchain |
| 16 | + uses: actions-rs/toolchain@v1 |
| 17 | + with: |
| 18 | + toolchain: stable |
| 19 | + override: true |
| 20 | + |
| 21 | + - name: Cache ArrayFire |
| 22 | + uses: actions/cache@v1 |
| 23 | + id: arrayfire |
| 24 | + with: |
| 25 | + path: afbin |
| 26 | + key: ${{ runner.os }}-af-${{ env.AF_VER }} |
| 27 | + |
| 28 | + - name: Download ArrayFire |
| 29 | + # Only download and cache arrayfire if already not found |
| 30 | + if: steps.arrayfire.outputs.cache-hit != 'true' |
| 31 | + run: | |
| 32 | + wget --quiet http://arrayfire.s3.amazonaws.com/${AF_VER}/ArrayFire-v${AF_VER}_Linux_x86_64.sh |
| 33 | + chmod +x ./ArrayFire-v${AF_VER}_Linux_x86_64.sh |
| 34 | + mkdir afbin |
| 35 | + ./ArrayFire-v${AF_VER}_Linux_x86_64.sh --skip-license --exclude-subdir --prefix=./afbin |
| 36 | + rm ./afbin/lib64/libcu*.so* |
| 37 | + rm ./afbin/lib64/libafcuda*.so* |
| 38 | + rm ./ArrayFire-v${AF_VER}_Linux_x86_64.sh |
| 39 | +
|
| 40 | + - name: Build and Run Tests |
| 41 | + run: | |
| 42 | + export AF_PATH=${GITHUB_WORKSPACE}/afbin |
| 43 | + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${AF_PATH}/lib64 |
| 44 | + echo "Using cargo version: $(cargo --version)" |
| 45 | + cargo test --no-fail-fast |
| 46 | +
|
| 47 | + format: |
| 48 | + name: Format Check |
| 49 | + runs-on: ubuntu-18.04 |
| 50 | + steps: |
| 51 | + - name: Checkout Repository |
| 52 | + uses: actions/checkout@master |
| 53 | + |
| 54 | + - name: Setup Rust Toolchain |
| 55 | + uses: actions-rs/toolchain@v1 |
| 56 | + with: |
| 57 | + toolchain: stable |
| 58 | + override: true |
| 59 | + components: rustfmt |
| 60 | + - name: Run rust fmt tool |
| 61 | + uses: actions-rs/cargo@v1 |
| 62 | + with: |
| 63 | + command: fmt |
| 64 | + args: --all -- --check |
0 commit comments