chore: Release #399
Workflow file for this run
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
| env: | |
| CARGO_INCREMENTAL: '0' | |
| CARGO_NET_RETRY: '10' | |
| RUSTUP_MAX_RETRIES: '10' | |
| RUST_BACKTRACE: short | |
| jobs: | |
| pre_ci: | |
| uses: valeratrades/.github/.github/workflows/pre_ci.yml@master | |
| rust-clippy: | |
| if: github.event_name != 'pull_request' | |
| name: Clippy | |
| needs: pre_ci | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@clippy | |
| - name: Install mold | |
| uses: rui314/setup-mold@v1 | |
| - name: Download modified by pre-ci Cargo.toml files | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: modified-cargo-files | |
| - run: cargo clippy --tests -- -Dwarnings | |
| timeout-minutes: 45 | |
| rust-doc: | |
| env: | |
| RUSTDOCFLAGS: -Dwarnings | |
| if: needs.pre_ci.outputs.continue | |
| name: Documentation | |
| needs: pre_ci | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - name: Install mold | |
| uses: rui314/setup-mold@v1 | |
| - name: Download modified by pre-ci Cargo.toml files | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: modified-cargo-files | |
| - uses: dtolnay/install@cargo-docs-rs | |
| - run: cargo docs-rs -p v_exchanges | |
| timeout-minutes: 45 | |
| rust-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" | |
| rust-sorted: | |
| 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 --workspace --grouped --check\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\nfi\n" | |
| rust-sorted-derives: | |
| name: Sorted Derives | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Installation | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-sort-derives | |
| - name: Assert derives are sorted | |
| run: "\t\t\t\tcargo sort-derives --check\n\t\t\t\texit_code=$?\n\t\t\t\tif [\ | |
| \ $exit_code != 0 ]; then\n\t\t\t\t\techo \"Derives are not sorted. Run \\\ | |
| `cargo sort-derives\\` to fix it.\"\n\t\t\t\t\texit $exit_code\n\t\t\t\tfi\n\ | |
| \t\t\t" | |
| 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\tcomments=$(jq '.Rust.comments' tokei_output.json)\n\t\t\t\tcode=$(jq\ | |
| \ '.Rust.code' tokei_output.json)\n\n\t\t\t\t# compare: comments > code *\ | |
| \ 0.15\n\t\t\t\tif [ $((comments * 100)) -ge $((code * 15)) ]; then\n\t\t\t\ | |
| \t\t\techo \"Number of comments should be less than 15% of code\"\n\t\t\t\t\ | |
| \t\texit 1\n\t\t\t\telse\n\t\t\t\t\t\techo \"Check passed: Number of comments\ | |
| \ is less than 15% of code\"\n\t\t\t\tfi\n \t\t\t" | |
| name: Warnings | |
| 'on': | |
| pull_request: {} | |
| push: {} | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: read |