-
Notifications
You must be signed in to change notification settings - Fork 83
79 lines (73 loc) · 2.32 KB
/
Copy pathci.yml
File metadata and controls
79 lines (73 loc) · 2.32 KB
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
name: CI
on:
push:
branches: ["main"]
pull_request:
merge_group:
types: [checks_requested]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
jobs:
ci:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.85, nightly, stable]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
default: true
override: true
- name: Build
run: |
cargo build --no-default-features
cargo build
cargo build --workspace
cargo build --workspace --features malloc_size_of
- name: Run tests
run: |
cargo test --workspace
cargo test --workspace --benches
- name: Run Clippy
if: ${{ matrix.rust == 'stable' }}
run: cargo clippy --workspace --all-targets
- name: Install Miri
if: ${{ matrix.rust == 'nightly' }}
run: |
rustup component add miri
cargo miri setup
cargo miri setup --target i686-unknown-linux-gnu
cargo miri setup --target s390x-unknown-linux-gnu
- name: Run Miri
if: ${{ matrix.rust == 'nightly' }}
# TODO: run without permissive provenance: https://github.com/servo/string-cache/issues/264
run: MIRIFLAGS=-Zmiri-permissive-provenance cargo miri test --workspace
- name: Run Miri on 32-bit
if: ${{ matrix.rust == 'nightly' }}
run: MIRIFLAGS=-Zmiri-permissive-provenance cargo miri test --workspace --target i686-unknown-linux-gnu
- name: Run Miri on big-endian
if: ${{ matrix.rust == 'nightly' }}
run: MIRIFLAGS=-Zmiri-permissive-provenance cargo miri test --workspace --target s390x-unknown-linux-gnu
build-result:
name: Result
runs-on: ubuntu-latest
if: always()
# needs all build to detect cancellation
needs:
- ci
steps:
- name: Success
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
run: exit 0
- name: Failure
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1