| 1 |
name: Rust |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
|
| 6 |
|
| 7 |
branches: |
| 8 |
- master |
| 9 |
- release* |
| 10 |
pull_request: |
| 11 |
|
| 12 |
|
| 13 |
branches: |
| 14 |
- master |
| 15 |
|
| 16 |
env: |
| 17 |
CARGO_TERM_COLOR: always |
| 18 |
|
| 19 |
jobs: |
| 20 |
build: |
| 21 |
name: Check Code |
| 22 |
runs-on: ubuntu-latest |
| 23 |
steps: |
| 24 |
- name: Checkout sources |
| 25 |
uses: actions/[email protected] |
| 26 |
|
| 27 |
- name: Install Rust stable toolchain |
| 28 |
uses: actions-rs/[email protected] |
| 29 |
with: |
| 30 |
profile: minimal |
| 31 |
toolchain: stable |
| 32 |
override: true |
| 33 |
|
| 34 |
- name: Rust Cache |
| 35 |
uses: Swatinem/[email protected] |
| 36 |
|
| 37 |
- name: Build |
| 38 |
uses: actions-rs/[email protected] |
| 39 |
with: |
| 40 |
command: check |
| 41 |
args: --all-targets --all-features |
| 42 |
|
| 43 |
fmt: |
| 44 |
name: Run rustfmt |
| 45 |
runs-on: ubuntu-latest |
| 46 |
steps: |
| 47 |
- name: Checkout sources |
| 48 |
uses: actions/[email protected] |
| 49 |
|
| 50 |
- name: Install Rust stable toolchain |
| 51 |
uses: actions-rs/[email protected] |
| 52 |
with: |
| 53 |
profile: minimal |
| 54 |
toolchain: stable |
| 55 |
override: true |
| 56 |
components: clippy, rustfmt |
| 57 |
|
| 58 |
- name: Rust Cache |
| 59 |
uses: Swatinem/[email protected] |
| 60 |
|
| 61 |
- name: Cargo fmt |
| 62 |
uses: actions-rs/[email protected] |
| 63 |
with: |
| 64 |
command: fmt |
| 65 |
args: --all -- --check |
| 66 |
|
| 67 |
docs: |
| 68 |
name: Check Documentation |
| 69 |
runs-on: ubuntu-latest |
| 70 |
steps: |
| 71 |
- name: Checkout sources |
| 72 |
uses: actions/[email protected] |
| 73 |
|
| 74 |
- name: Install Rust stable toolchain |
| 75 |
uses: actions-rs/[email protected] |
| 76 |
with: |
| 77 |
profile: minimal |
| 78 |
toolchain: stable |
| 79 |
override: true |
| 80 |
|
| 81 |
- name: Rust Cache |
| 82 |
uses: Swatinem/[email protected] |
| 83 |
|
| 84 |
- name: Check internal documentation links |
| 85 |
run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items |
| 86 |
|
| 87 |
tests: |
| 88 |
name: Run tests |
| 89 |
runs-on: ubuntu-latest |
| 90 |
steps: |
| 91 |
- name: Checkout sources |
| 92 |
uses: actions/[email protected] |
| 93 |
|
| 94 |
- name: Install Rust stable toolchain |
| 95 |
uses: actions-rs/[email protected] |
| 96 |
with: |
| 97 |
profile: minimal |
| 98 |
toolchain: stable |
| 99 |
override: true |
| 100 |
|
| 101 |
- name: Rust Cache |
| 102 |
uses: Swatinem/[email protected] |
| 103 |
|
| 104 |
- name: Cargo build |
| 105 |
uses: actions-rs/[email protected] |
| 106 |
with: |
| 107 |
command: build |
| 108 |
args: --workspace |
| 109 |
|
| 110 |
- name: Cargo test |
| 111 |
uses: actions-rs/[email protected] |
| 112 |
with: |
| 113 |
command: test |
| 114 |
|