name: Continuous integration
on: [push, pull_request]
jobs:
linux-native:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
toolchain: ${{ matrix.channel }}
- uses: actions-rs/cargo@v1
with:
command: test
args: -vv --features=${{ matrix.features }} --no-run
strategy:
matrix:
channel: [stable, beta]
features: ["", "vendored-lzma,vendored-zstd"]
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
toolchain: ${{ matrix.channel }}
target: ${{ matrix.target }}
- run: brew install automake
- uses: actions-rs/cargo@v1
with:
command: test
args: --features=${{ matrix.features }} --target ${{ matrix.target }} -vv --no-run
strategy:
matrix:
channel: [stable, beta]
features: ["vendored-openssl", "vendored-openssl,vendored-lzma,vendored-zstd"]
target:
- x86_64-apple-darwin
- aarch64-apple-ios
- x86_64-apple-ios
linux-cross-ndk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
toolchain: ${{ matrix.channel }}
target: ${{ matrix.target }}
- run: echo "$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
- run: echo "TARGET_AR=llvm-ar" >> $GITHUB_ENV
- run: echo "RUSTFLAGS=-C panic=abort" >> $GITHUB_ENV
- if: ${{ matrix.target == 'aarch64-linux-android' }}
run: |
echo "CC_aarch64_linux_android=aarch64-linux-android24-clang" >> $GITHUB_ENV
echo "RUSTFLAGS=-C panic=abort" >> $GITHUB_ENV
- if: ${{ matrix.target == 'armv7-linux-androideabi' }}
run: |
echo "CC_armv7_linux_androideabi=armv7a-linux-androideabi24-clang" >> $GITHUB_ENV
echo "RUSTFLAGS=-C panic=abort" >> $GITHUB_ENV
- if: ${{ matrix.target == 'i686-linux-android' }}
run: |
echo "CC_i686_linux_android=i686-linux-android24-clang" >> $GITHUB_ENV
echo "RUSTFLAGS=-C panic=abort" >> $GITHUB_ENV
- if: ${{ matrix.target == 'x86_64-linux-android' }}
run: |
echo "CC_x86_64_linux_android=x86_64-linux-android24-clang" >> $GITHUB_ENV
- uses: actions-rs/cargo@v1
with:
command: build
args: --features=${{ matrix.features }} --target ${{ matrix.target }} -vv
strategy:
matrix:
channel: [stable, beta]
features: ["vendored-openssl", "vendored-openssl,vendored-lzma,vendored-zstd"]
target:
- aarch64-linux-android
- armv7-linux-androideabi
- i686-linux-android
- x86_64-linux-android
linux-cross-windows:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
toolchain: ${{ matrix.channel }}
target: ${{ matrix.target }}
- run: sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 libnpth-mingw-w64-dev
- uses: actions-rs/cargo@v1
with:
command: test
args: --features=${{ matrix.features }} --target ${{ matrix.target }} -vv --no-run
strategy:
matrix:
channel: [stable, beta]
features: ["vendored-openssl", "vendored-openssl,vendored-lzma,vendored-zstd"]
target:
- i686-pc-windows-gnu
- x86_64-pc-windows-gnu
fmt:
name: Rust fmt
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check