-
Notifications
You must be signed in to change notification settings - Fork 26
63 lines (57 loc) · 2.1 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# We use `actions-rs` for most of our actions
#
# This file is for the main tests. clippy & rustfmt are seperate workflows
#
# It is mostly copied from slog-rs/term
on: [push, pull_request]
name: Cargo Test
env:
CARGO_TERM_COLOR: always
# has a history of occasional bugs (especially on old versions)
#
# the ci is free so we might as well use it ;)
CARGO_INCREMENTAL: 0
# Tested versions:
# 1. stable
# 2. nightly
# 3. Minimum Supported Rust Version (MSRV)
jobs:
test:
# Only run on PRs if the source branch is on someone else's repo
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false # Even if one job fails we still want to see the other ones
matrix:
# 1.39 is MSRV. Keep in sync with Cargo.toml
#
# There are no MSRV guarentees for the kv_unstable feature.
# See `Cargo.toml` for more details.
rust: [1.39, stable, nightly]
# NOTE: Features to test must be specified manually. They are applied to all versions seperately.
#
# This has the advantage of being more flexibile and thorough
# This has the disadvantage of being more vebrose
#
# Specific feature combos can be overriden per-version with 'include' and 'exclude'
features: ["", "kv_unstable"]
exclude:
- rust: 1.39 # MSRV (see above)
features: "kv_unstable"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Check
run: |
cargo check --verbose --features "${{ matrix.features }}"
# A failing `cargo check` always fails the build
continue-on-error: false
# NOTE: We only run `cargo test` if version > MSRV. Tests break on old MSRV due to
# a dev-dependency.
- name: Test
run: |
cargo test --verbose --features "${{ matrix.features }}"
if: "${{ matrix.rust == 'stable' || matrix.rust == 'nightly' }}"