release: v0.2.4 #83
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
name: Build | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [stable, beta, nightly] | |
target: | |
- x86_64-unknown-linux-gnu | |
- x86_64-unknown-linux-musl | |
- i686-unknown-linux-gnu | |
- i686-unknown-linux-musl | |
features: | |
- '' | |
- serde | |
- std serde | |
include: | |
- toolchain: nightly | |
target: x86_64-unknown-linux-gnu | |
features: sc | |
# Allow nightly builds to fail | |
continue-on-error: ${{ matrix.toolchain == 'nightly' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up repo | |
uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
targets: ${{ matrix.target }} | |
- name: Install 32-bit glibc build dependencies | |
run: sudo apt-get update && sudo apt-get -y install gcc-multilib | |
if: matrix.target == 'i686-unknown-linux-gnu' | |
- name: Build | |
run: cargo +${{ matrix.toolchain }} build --verbose --target ${{ matrix.target }} --no-default-features --features "${{ matrix.features }}" | |
- name: Run tests | |
run: cargo +${{ matrix.toolchain }} test --verbose --target ${{ matrix.target }} --no-default-features --features "${{ matrix.features }}" | |
- name: Run tests (in user namespace) | |
run: unshare -r cargo +${{ matrix.toolchain }} test --verbose --target ${{ matrix.target }} --no-default-features --features "${{ matrix.features }}" | |
coverage-tarpaulin: | |
name: Tarpaulin | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [stable] | |
target: | |
- x86_64-unknown-linux-gnu | |
- x86_64-unknown-linux-musl | |
features: | |
- '' | |
prefix: | |
- '' | |
- unshare -r | |
include: | |
- toolchain: nightly | |
target: x86_64-unknown-linux-gnu | |
features: sc | |
prefix: '' | |
- toolchain: nightly | |
target: x86_64-unknown-linux-gnu | |
features: sc | |
prefix: unshare -r | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
target: ${{ matrix.target }} | |
- name: Install tarpaulin | |
run: cargo install cargo-tarpaulin | |
- name: Run tarpaulin | |
run: ${{ matrix.prefix }} cargo +${{ matrix.toolchain }} tarpaulin --verbose --out Xml --target ${{ matrix.target }} --features "${{ matrix.features }}" | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
name: ${{ matrix.toolchain }}-${{ matrix.target }} | |
fail_ci_if_error: true | |
env_vars: OS,TARGET,TOOLCHAIN,JOB | |
env: | |
JOB: ${{ github.job }} | |
OS: ${{ matrix.os }} | |
TARGET: ${{ matrix.target }} | |
TOOLCHAIN: ${{ matrix.toolchain }} | |
FEATURES: ${{ matrix.features }} |