diff --git a/.github/workflows/cross-platform-testing.yml b/.github/workflows/cross-platform-testing.yml new file mode 100644 index 0000000..ba9437b --- /dev/null +++ b/.github/workflows/cross-platform-testing.yml @@ -0,0 +1,74 @@ +name: release +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + build-release: + name: test + runs-on: ${{ matrix.os }} + env: + # For some builds, we use cross to test on 32-bit and big-endian + # systems. + CARGO: cargo + # When CARGO is set to CROSS, this is set to `--target matrix.target`. + TARGET_FLAGS: + # When CARGO is set to CROSS, TARGET_DIR includes matrix.target. + TARGET_DIR: ./target + # Emit backtraces on panics. + RUST_BACKTRACE: 1 + strategy: + matrix: + build: [linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc] + include: + - build: linux + os: ubuntu-18.04 + rust: nightly + target: x86_64-unknown-linux-musl + - build: linux-arm + os: ubuntu-18.04 + rust: nightly + target: arm-unknown-linux-gnueabihf + - build: macos + os: macos-latest + rust: nightly + target: x86_64-apple-darwin + - build: win-msvc + os: windows-2019 + rust: nightly + target: x86_64-pc-windows-msvc + - build: win-gnu + os: windows-2019 + rust: nightly-x86_64-gnu + target: x86_64-pc-windows-gnu + - build: win32-msvc + os: windows-2019 + rust: nightly + target: i686-pc-windows-msvc + + steps: + - name: Checkout repository + uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + profile: minimal + override: true + target: ${{ matrix.target }} + + - name: Show command used for Cargo + if: success() + run: | + echo "cargo command is: ${{ env.CARGO }}" + echo "target flag is: ${{ env.TARGET_FLAGS }}" + echo "target dir is: ${{ env.TARGET_DIR }}" + + - name: Run tests + if: success() + run: ${{ env.CARGO }} test ${{ env.TARGET_FLAGS }} +