|
11 | 11 | - cron: "0 0 * * 0"
|
12 | 12 |
|
13 | 13 | jobs:
|
14 |
| - lint: |
15 |
| - name: Lint |
16 |
| - runs-on: ubuntu-latest |
17 |
| - |
18 |
| - steps: |
19 |
| - - name: Checkout the repository |
20 |
| - uses: actions/checkout@v4 |
21 |
| - |
22 |
| - - name: Install dependencies |
23 |
| - run: | |
24 |
| - sudo apt-get update |
25 |
| - sudo apt-get install -y \ |
26 |
| - --no-install-recommends \ |
27 |
| - --allow-unauthenticated \ |
28 |
| - libasound2-dev \ |
29 |
| - libxi-dev \ |
30 |
| - libxtst-dev \ |
31 |
| - pkg-config |
32 |
| -
|
33 |
| - - name: Install Rust toolchain |
34 |
| - uses: dtolnay/rust-toolchain@stable |
35 |
| - |
36 |
| - - name: Cache Cargo dependencies |
37 |
| - uses: Swatinem/rust-cache@v2 |
38 |
| - |
39 |
| - - name: Check formatting |
40 |
| - run: cargo fmt --all -- --check |
41 |
| - |
42 |
| - - name: Check lints |
43 |
| - run: cargo clippy -- -D warnings |
44 |
| - |
45 | 14 | build:
|
46 | 15 | name: Build on ${{ matrix.build.OS }} (${{ matrix.build.TARGET }})
|
47 | 16 | runs-on: ${{ matrix.build.OS }}
|
|
98 | 67 | with:
|
99 | 68 | name: daktilo-${{ matrix.build.TARGET }}-assets
|
100 | 69 | path: target/debug/daktilo*
|
| 70 | + |
| 71 | + lint: |
| 72 | + name: Lint |
| 73 | + runs-on: ubuntu-latest |
| 74 | + |
| 75 | + steps: |
| 76 | + - name: Checkout the repository |
| 77 | + if: github.event_name != 'pull_request' |
| 78 | + uses: actions/checkout@v4 |
| 79 | + |
| 80 | + - name: Checkout the repository |
| 81 | + if: github.event_name == 'pull_request' |
| 82 | + uses: actions/checkout@v4 |
| 83 | + with: |
| 84 | + ref: ${{ github.event.pull_request.head.sha }} |
| 85 | + |
| 86 | + - name: Install dependencies |
| 87 | + run: | |
| 88 | + sudo apt-get update |
| 89 | + sudo apt-get install -y \ |
| 90 | + --no-install-recommends \ |
| 91 | + --allow-unauthenticated \ |
| 92 | + libasound2-dev \ |
| 93 | + libxi-dev \ |
| 94 | + libxtst-dev \ |
| 95 | + pkg-config |
| 96 | +
|
| 97 | + - name: Install Rust toolchain |
| 98 | + uses: dtolnay/rust-toolchain@stable |
| 99 | + with: |
| 100 | + components: rustfmt, clippy |
| 101 | + |
| 102 | + - name: Cache Cargo dependencies |
| 103 | + uses: Swatinem/rust-cache@v2 |
| 104 | + |
| 105 | + - name: Check formatting |
| 106 | + run: cargo fmt --all -- --check |
| 107 | + |
| 108 | + - name: Check lints |
| 109 | + run: cargo clippy -- -D warnings |
| 110 | + |
| 111 | + - name: Run cargo-deny |
| 112 | + uses: EmbarkStudios/cargo-deny-action@v1 |
| 113 | + with: |
| 114 | + command: check licenses sources |
| 115 | + |
| 116 | + - name: Run cargo-audit |
| 117 | + uses: actions-rs/audit-check@v1 |
| 118 | + with: |
| 119 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 120 | + |
| 121 | + - name: Run committed |
| 122 | + uses: crate-ci/committed@master |
| 123 | + with: |
| 124 | + args: "-vv" |
| 125 | + commits: "HEAD" |
| 126 | + |
| 127 | + - name: Run lychee |
| 128 | + uses: lycheeverse/lychee-action@v1 |
| 129 | + with: |
| 130 | + args: -v *.md |
| 131 | + env: |
| 132 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 133 | + |
| 134 | + - name: Check typos |
| 135 | + uses: crate-ci/typos@master |
| 136 | + |
| 137 | + - name: Run cargo-msrv |
| 138 | + shell: bash |
| 139 | + run: | |
| 140 | + curl -s 'https://api.github.com/repos/foresterre/cargo-msrv/releases' | \ |
| 141 | + jq -r "[.[] | select(.prerelease == false)][0].assets[] | \ |
| 142 | + select(.name | ascii_downcase | test(\"linux.*x86_64|x86_64.*linux\")).browser_download_url" | \ |
| 143 | + wget -qi - |
| 144 | + tar -xvf cargo-msrv*.tar* -C ~/.cargo/bin/ cargo-msrv |
| 145 | + printf "%s" "Checking MSRV..." |
| 146 | + cargo msrv --output-format json verify | tail -n 1 | jq --exit-status '.success' |
0 commit comments