|
| 1 | +name: Static code checks |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - "**" # target all branches |
| 10 | + |
| 11 | +env: |
| 12 | + CARGO_TERM_COLOR: always |
| 13 | + RUST_LOG: debug |
| 14 | + RUST_BACKTRACE: full |
| 15 | + |
| 16 | +jobs: |
| 17 | + static_checks_ubuntu: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - name: Checkout the repository |
| 21 | + uses: actions/checkout@v5 |
| 22 | + with: |
| 23 | + submodules: recursive |
| 24 | + |
| 25 | + - name: Update the list of available system packages |
| 26 | + run: sudo apt-get update |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: sudo apt-get install -yqq --no-install-recommends build-essential |
| 30 | + |
| 31 | + - name: Setup Python |
| 32 | + uses: actions/setup-python@v6 |
| 33 | + with: |
| 34 | + python-version-file: './build-tools/.python-version' |
| 35 | + |
| 36 | + - name: Install Rust |
| 37 | + run: | |
| 38 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ |
| 39 | + --default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version) |
| 40 | +
|
| 41 | + - name: Install Clippy |
| 42 | + run: rustup component add clippy |
| 43 | + |
| 44 | + - name: Install cargo-deny |
| 45 | + run: cargo install cargo-deny --locked |
| 46 | + |
| 47 | + - name: Run checks |
| 48 | + run: ./do_checks.sh |
| 49 | + |
| 50 | + static_checks_macos: |
| 51 | + runs-on: macos-latest |
| 52 | + steps: |
| 53 | + - name: Checkout the repository |
| 54 | + uses: actions/checkout@v5 |
| 55 | + with: |
| 56 | + submodules: recursive |
| 57 | + |
| 58 | + - name: Setup Python |
| 59 | + uses: actions/setup-python@v6 |
| 60 | + with: |
| 61 | + python-version-file: './build-tools/.python-version' |
| 62 | + |
| 63 | + - name: Install Rust |
| 64 | + run: | |
| 65 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ |
| 66 | + --default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version) |
| 67 | +
|
| 68 | + - name: Install Clippy |
| 69 | + run: rustup component add clippy |
| 70 | + |
| 71 | + - name: Install cargo-deny |
| 72 | + run: cargo install cargo-deny --locked |
| 73 | + |
| 74 | + - name: Run checks |
| 75 | + shell: bash |
| 76 | + run: ./do_checks.sh |
| 77 | + |
| 78 | + static_checks_windows: |
| 79 | + runs-on: windows-latest |
| 80 | + steps: |
| 81 | + # This prevents git from changing line-endings to crlf, which messes cargo fmt checks |
| 82 | + - name: Set git to use LF |
| 83 | + run: | |
| 84 | + git config --global core.autocrlf false |
| 85 | + git config --global core.eol lf |
| 86 | +
|
| 87 | + - name: Checkout the repository |
| 88 | + uses: actions/checkout@v5 |
| 89 | + with: |
| 90 | + submodules: recursive |
| 91 | + |
| 92 | + - name: Setup Python |
| 93 | + uses: actions/setup-python@v6 |
| 94 | + with: |
| 95 | + python-version-file: './build-tools/.python-version' |
| 96 | + |
| 97 | + - name: Install Rust |
| 98 | + # Use bash to be able to escape the newline via '\'. |
| 99 | + shell: bash |
| 100 | + run: | |
| 101 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ |
| 102 | + --default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version) |
| 103 | +
|
| 104 | + - name: Install Clippy |
| 105 | + run: rustup component add clippy |
| 106 | + |
| 107 | + - name: Install cargo-deny |
| 108 | + run: cargo install cargo-deny --locked |
| 109 | + |
| 110 | + - name: Run checks |
| 111 | + shell: bash |
| 112 | + run: ./do_checks.sh |
0 commit comments