summaryrefslogtreecommitdiffstats
path: root/.cirrus.yml
blob: e9908f293005103d31bf9aff6f98126c1552781b (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Configuration for CirrusCI. This is primarily used for
# FreeBSD and macOS M1 tests and builds.

env:
  CARGO_INCREMENTAL: 0
  CARGO_PROFILE_DEV_DEBUG: 0
  CARGO_HUSKY_DONT_INSTALL_HOOKS: true

task:
  name: "FreeBSD 13 Test"
  only_if: $CIRRUS_BRANCH == "master" || $CIRRUS_PR != ""
  freebsd_instance:
    image_family: freebsd-13-1
  matrix:
    - env:
        FEATURES: "--all-features"
    - env:
        FEATURES: "--no-default-features"
  setup_script:
    - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output rustup.sh
    - sh rustup.sh --default-toolchain stable -y
    - . $HOME/.cargo/env
    - rustc --version
  registry_cache:
    folder: $HOME/.cargo/registry
    reupload_on_changes: true
    fingerprint_script: md5 Cargo.lock
  target_cache:
    folder: target
    reupload_on_changes: true
    fingerprint_script:
      - . $HOME/.cargo/env && rustc --version
      - md5 Cargo.lock
      - echo $FEATURES
  test_script:
    - . $HOME/.cargo/env
    - cargo fmt --all -- --check
    - cargo test --no-run --locked $FEATURES
    - cargo test --no-fail-fast $FEATURES -- --nocapture --quiet 
    - cargo clippy --all-targets --workspace $FEATURES -- -D warnings
  before_cache_script:
    - rm -rf $HOME/.cargo/registry/index
    - rm -f ./target/.rustc_info.json
    - find ./target/debug -maxdepth 1 -type f -delete # Delete stray files

task:
  name: "macOS M1 Test"
  only_if: $CIRRUS_BRANCH == "master" || $CIRRUS_PR != ""
  macos_instance:
    image: ghcr.io/cirruslabs/macos-monterey-base:latest
  matrix:
    - env:
        FEATURES: "--all-features"
    - env:
        FEATURES: "--no-default-features"
  setup_script:
    - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output rustup.sh
    - sh rustup.sh --default-toolchain stable -y
    - source $HOME/.cargo/env
    - rustc --version
  registry_cache:
    folder: $HOME/.cargo/registry
    reupload_on_changes: true
    fingerprint_script: md5 Cargo.lock
  target_cache:
    folder: target
    reupload_on_changes: true
    fingerprint_script:
      - source $HOME/.cargo/env && rustc --version
      - md5 Cargo.lock
      - echo $FEATURES
  test_script:
    - . $HOME/.cargo/env
    - cargo fmt --all -- --check
    - cargo test --no-run --locked $FEATURES
    - cargo test --no-fail-fast $FEATURES -- --nocapture --quiet 
    - cargo clippy --all-targets --workspace $FEATURES -- -D warnings
  before_cache_script:
    - rm -rf $HOME/.cargo/registry/index
    - rm -f ./target/.rustc_info.json
    - find ./target/debug -maxdepth 1 -type f -delete # Delete stray files