-
Notifications
You must be signed in to change notification settings - Fork 21
66 lines (54 loc) · 1.73 KB
/
check.yml
File metadata and controls
66 lines (54 loc) · 1.73 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
name: Quality Checks
on:
push:
branches:
- '**'
tags-ignore:
- '**'
pull_request:
workflow_call:
jobs:
load-config:
name: Load CI Configuration
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.config.outputs.targets }}
rust_components: ${{ steps.config.outputs.rust_components }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Load configuration
id: config
run: |
TARGETS=$(jq -c '.targets' .github/config.json)
COMPONENTS=$(jq -r '.rust_components | join(", ")' .github/config.json)
echo "targets=$TARGETS" >> $GITHUB_OUTPUT
echo "rust_components=$COMPONENTS" >> $GITHUB_OUTPUT
check:
name: Check
runs-on: ubuntu-latest
needs: load-config
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.load-config.outputs.targets) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: ${{ needs.load-config.outputs.rust_components }}
targets: ${{ matrix.target }}
- name: Check rust version
run: rustc --version --verbose
- name: Check code format
run: cargo fmt --all -- --check
- name: Build
run: cargo build --target ${{ matrix.target }} --all-features
- name: Run clippy
run: cargo clippy --target ${{ matrix.target }} --all-features -- -D warnings
- name: Build documentation
env:
RUSTDOCFLAGS: -D rustdoc::broken_intra_doc_links -D missing-docs
run: cargo doc --no-deps --target ${{ matrix.target }} --all-features