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
name: CI
on:
pull_request:
branches: "main"
paths:
# `README.md` is included in `src/lib.rs` as a doc comment,
# meaning any changes potentially affecting it's code running,
# should be validated..
- "README.md"
- "**.rs"
- "**.toml"
types:
- opened
- synchronize
- reopened
workflow_call:
env:
CARGO_TERM_COLOR: always
jobs:
validate-pull:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
- 1.63.0 # MSRV
steps:
- uses: actions/checkout@v3
- name: Cargo Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target/
key: ${{ runner.os }}-cargo-${{ matrix.toolchain }}-${{ hashFiles('Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-${{ matrix.toolchain }}-
${{ runner.os }}-cargo-
${{ runner.os }}-
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} && rustup component add clippy --toolchain ${{matrix.toolchain}}
# Validating the formatting of the project shouldn't do very much currently,
# due to the `rustfmt`'s macro formatting options being nightly exlusive,
# but hopefully shouldn't add any significant overhead in jobs, and require minimal maintainance in future...
#
# Additionally, the library is designed on the stable branch, meaning the check should run on a stable version.
- name: Validate Formatting
if: matrix.toolchain == 'stable'
run: cargo fmt --check --verbose
- name: Validate Clippy
run: cargo clippy -- -D warnings --verbose
- name: Validate Standard Tests
run: cargo test --verbose
# As this file is running tests on a library for generating tests,
# it's required that it run tests on both standard tests,
# and ignored cases, as generating such tests, is included in it's expected bahaviour...
- name: Validate Ignored Tests
run: cargo test --verbose -- --ignored