name: ci on: [pull_request, push] env: # Just a reassurance to mitigate sudden network connection problems CARGO_NET_RETRY: 10 RUSTUP_MAX_RETRIES: 10 CARGO_INCREMENTAL: 0 RUST_BACKTRACE: full # We don't need any debug symbols on ci, this also speeds up builds a bunch RUSTFLAGS: --deny warnings -Cdebuginfo=0 RUSTDOCFLAGS: --deny warnings jobs: rust-lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable profile: minimal components: rustfmt, clippy - run: cargo clippy --workspace - run: cargo fmt --all -- --check rust-test: runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.continue-on-error }} strategy: matrix: os: - ubuntu-latest - windows-latest - macos-latest toolchain: - stable features: - --all-features - --no-default-features - --no-default-features --features colors - --no-default-features --features timestamps continue-on-error: - false exclude: - { os: macos-latest, toolchain: stable, features: --all-features } - { os: macos-latest, toolchain: stable, features: --no-default-features --features timestamps, } include: - { os: ubuntu-latest, toolchain: beta, features: --all-features, continue-on-error: true, } - { os: ubuntu-latest, toolchain: nightly, features: --all-features, continue-on-error: true, } - { os: macos-latest, toolchain: stable, features: --all-features, continue-on-error: true, } - { os: macos-latest, toolchain: stable, features: --no-default-features --features timestamps, continue-on-error: true, } steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.toolchain }} profile: minimal - run: cargo +${{ matrix.toolchain }} build ${{ matrix.features }} - run: cargo +${{ matrix.toolchain }} test ${{ matrix.features }} rust-publish-crates: if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest needs: - rust-lint - rust-test steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable profile: minimal - run: cargo publish --token ${{ secrets.CRATES_TOKEN }}