forked from mmaroti/cadical-rs
-
Notifications
You must be signed in to change notification settings - Fork 2
152 lines (130 loc) · 5.92 KB
/
ci.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# More information can be found here:
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
###################################################################################################
# Workflow name
###################################################################################################
# standard name for CI workflow
name: CI
###################################################################################################
# When to run the workflow
###################################################################################################
# perform CI only on main branch
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
###################################################################################################
# environment variables
###################################################################################################
# more information can be found at https://doc.rust-lang.org/cargo/reference/environment-variables.html
env:
# Controls whether or not colored output is used in the terminal.
CARGO_TERM_COLOR: always # always: Always display colors.
# Make sure CI fails on all warnings, including Clippy lints
# RUSTFLAGS: "-Dwarnings" this cannot be enabled since some libs have warnings
###################################################################################################
# jobs
###################################################################################################
jobs:
#################################################################################################
# Sanity job
#################################################################################################
# These 4 were grouped together because they all require installation of dependencies
fmt-check-clippy-build:
# job name will be displayed in the GitHub UI
name: Format / Check / Clippy / Docs / Test
# job will run on ubuntu-latest
runs-on: ubuntu-latest
# job timeout, shouldn't take longer really
timeout-minutes: 5
# job steps
steps:
# This action checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
- uses: actions/checkout@v3
# This GitHub Action installs a Rust toolchain using rustup. It is designed for one-line concise usage and good defaults.
- uses: dtolnay/rust-toolchain@stable
# used by popular Rust projects to check formatting
- run: cargo fmt --all --check
# check is a weaker version of clippy but it is faster
- run: cargo check --all-targets --all-features
# source https://doc.rust-lang.org/nightly/clippy/continuous_integration/github_actions.html
- run: cargo clippy --all-targets --all-features -- -D warnings
# A more pedantic version that should probably be used in the future, but it is too much for now
# - run: cargo clippy --all-targets --all-features -- -D warnings -Dclippy::all -Dclippy::pedantic
# try and build the project
- run: cargo build --verbose
# source https://github.com/dtolnay/syn/blob/master/.github/workflows/ci.yml
- run: cargo test --all-features --doc
- run: cargo doc --all-features
# run test suite
- run: cargo test --verbose
# test cargo clean
- run: cargo clean --verbose
# run test suite
- run: cargo test --verbose
#################################################################################################
# test docs job
#################################################################################################
# test-docs:
# name: Test Documentation
# # run only if the previous job succeeded
# # needs: fmt-check-clippy-build
# runs-on: ubuntu-latest
# timeout-minutes: 5
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# # source https://github.com/dtolnay/syn/blob/master/.github/workflows/ci.yml
# - run: cargo test --all-features --doc
# - run: cargo doc --all-features
#################################################################################################
# test job
#################################################################################################
# test:
# name: Test
# # needs: test-docs
# runs-on: ubuntu-latest
# timeout-minutes: 10
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# - run: cargo test --verbose
#################################################################################################
# Miri job
#################################################################################################
# miri:
# name: Miri
# needs: test
# runs-on: ubuntu-latest
# timeout-minutes: 20
# steps:
# - uses: actions/checkout@v3
# # source https://github.com/dtolnay/anyhow/blob/master/.github/workflows/ci.yml
# - uses: dtolnay/rust-toolchain@miri
# - run: cargo miri setup
# - run: cargo miri test --test miri
# env:
# MIRIFLAGS: -Zmiri-strict-provenance
#################################################################################################
# Windows job
#################################################################################################
# windows:
# name: Windows
# runs-on: windows-latest
# timeout-minutes: 4
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# - run: cargo test --verbose
#################################################################################################
# Windows job
#################################################################################################
mac-os:
name: Mac-OS
runs-on: macos-latest
timeout-minutes: 4
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --verbose