name: CI
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
thing:
- stable
- beta
- nightly
- macos-x86_64
- arm-android
- arm64-android
- i686-android
- x86_64-android
- i686-linux
- arm-linux
- aarch64-linux
- x86_64-musl
- x86_64-mingw
- i686-msvc
- i686-msvc-static
- x86_64-msvc
- x86_64-msvc-static
include:
- thing: stable
target: x86_64-unknown-linux-gnu
rust: stable
os: ubuntu-latest
- thing: beta
target: x86_64-unknown-linux-gnu
rust: beta
os: ubuntu-latest
- thing: nightly
target: x86_64-unknown-linux-gnu
rust: nightly
os: ubuntu-latest
- thing: macos-x86_64
target: x86_64-apple-darwin
rust: stable
os: macos-latest
- thing: arm-android
target: arm-linux-androideabi
rust: stable
os: ubuntu-latest
- thing: arm64-android
target: aarch64-linux-android
rust: stable
os: ubuntu-latest
- thing: i686-android
target: i686-linux-android
rust: stable
os: ubuntu-latest
- thing: x86_64-android
target: x86_64-linux-android
rust: stable
os: ubuntu-latest
- thing: i686-linux
target: i686-unknown-linux-gnu
rust: stable
os: ubuntu-latest
- thing: arm-linux
target: arm-unknown-linux-gnueabi
rust: stable
os: ubuntu-latest
- thing: aarch64-linux
target: aarch64-unknown-linux-gnu
rust: stable
os: ubuntu-latest
- thing: x86_64-musl
target: x86_64-unknown-linux-musl
rust: stable
os: ubuntu-latest
- thing: x86_64-mingw
target: x86_64-pc-windows-gnu
rust: stable
os: ubuntu-latest
- thing: i686-msvc
target: i686-pc-windows-msvc
rust: stable-i686-msvc
os: windows-2016
- thing: i686-msvc-static
target: i686-pc-windows-msvc
rust: stable-i686-msvc
os: windows-2016
crt_static: true
- thing: x86_64-msvc
target: x86_64-pc-windows-msvc
rust: stable-x86_64-msvc
os: windows-latest
- thing: x86_64-msvc-static
target: x86_64-pc-windows-msvc
rust: stable-x86_64-msvc
os: windows-latest
crt_static: true
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
shell: bash
- run: rustup target add ${{ matrix.target }}
- name: Set crt-static
if: matrix.crt_static == 'yes'
run: echo ::set-env name=RUSTFLAGS::-Ctarget-feature=+crt-static
shell: bash
- name: Use strawberry perl
if: startsWith(matrix.os, 'windows')
run: echo ::set-env name=OPENSSL_SRC_PERL::C:/Strawberry/perl/bin/perl
shell: bash
- run: |
set -e
cargo generate-lockfile
./ci/run-docker.sh ${{ matrix.target }}
if: "!startsWith(matrix.os, 'windows')"
name: Run tests (not Windows)
- run: |
cargo test --manifest-path testcrate/Cargo.toml --target ${{ matrix.target }}
cargo test --manifest-path testcrate/Cargo.toml --target ${{ matrix.target }} --release
cargo run --release --target ${{ matrix.target }} --manifest-path testcrate/Cargo.toml --features package
if: startsWith(matrix.os, 'windows')
name: Run tests (Windows)
shell: cmd
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check