style: _ #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jobs: | |
| clippy: | |
| if: github.event_name != 'pull_request' | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@clippy | |
| - run: cargo clippy --tests -- -Dwarnings | |
| timeout-minutes: 45 | |
| machete: | |
| name: Unused Dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Installation | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-machete | |
| - name: Cargo Machete | |
| run: "\t\t\t\t\t\tcargo machete\n\t\t\t\t\t\texit_code=$?\n\t\t\t\t\t\tif [\ | |
| \ $exit_code = 0 ]; then\n\t\t\t\t\t\t\techo \"Found unused dependencies\"\ | |
| \n\t\t\t\t\t\t\texit $exit_code\n\t\t\t\t\t\tfi\n\t\t\t" | |
| sort: | |
| name: Cargo Sorted | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Installation | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-sort | |
| - name: Check if Cargo.toml is sorted | |
| run: "cargo sort -wc\nexit_code=$?\nif [ $exit_code != 0 ]; then\n echo \"\ | |
| Cargo.toml is not sorted. Run \\`cargo sort -w\\` to fix it.\"\n exit $exit_code\n\ | |
| fi\n" | |
| tokei: | |
| name: Reasonable Amount of Comments | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Installation | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: tokei | |
| - name: Generate Tokei output | |
| run: tokei -o json > tokei_output.json | |
| - name: Install jq | |
| run: sudo apt-get install -y jq | |
| - name: Check Rust comments | |
| run: "\t\t\t\t\t\tcomments=$(jq '.Rust.comments' tokei_output.json)\n\t\t\t\t\ | |
| \t\tcode=$(jq '.Rust.code' tokei_output.json)\n\t\t\t\t\t\tif [ $((comments\ | |
| \ * 10)) -ge $code ]; then\n\t\t\t\t\t\t\techo \"Number of comments should\ | |
| \ be less than 10% of code\"\n\t\t\t\t\t\t\texit 1\n\t\t\t\t\t\telse\n\t\t\ | |
| \t\t\t\t\techo \"Check passed: Number of comments is less than 10% of code\"\ | |
| \n\t\t\t\t\t\tfi\n\t\t\t" | |
| name: Warnings | |
| 'on': | |
| pull_request: {} | |
| push: {} | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read |