1name: cargo fmt23on:4 workflow_call:56jobs:7 rustfmt:8 runs-on: self-hosted-ci910 steps:11 - name: Skip if pull request is in Draft12 # `if: github.event.pull_request.draft == true` should be kept here, at13 # the step level, rather than at the job level. The latter is not14 # recommended because when the PR is moved from "Draft" to "Ready to15 # review" the workflow will immediately be passing (since it was skipped),16 # even though it hasn't actually ran, since it takes a few seconds for17 # the workflow to start. This is also disclosed in:18 # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/1719 # That scenario would open an opportunity for the check to be bypassed:20 # 1. Get your PR approved21 # 2. Move it to Draft22 # 3. Push whatever commits you want23 # 4. Move it to "Ready for review"; now the workflow is passing (it was24 # skipped) and "Check reviews" is also passing (it won't be updated25 # until the workflow is finished)26 if: github.event.pull_request.draft == true27 run: exit 12829 - uses: actions/checkout@v330 - name: Install latest nightly31 uses: actions-rs/toolchain@v132 with:33 toolchain: nightly34 default: true35 target: wasm32-unknown-unknown36 components: rustfmt, clippy 37 - name: Run cargo fmt38 run: cargo fmt -- --check # In that mode it returns only exit code.39 - name: Cargo fmt state40 if: success()41 run: echo "Nothing to do. Command 'cargo fmt -- --check' returned exit code 0."424344 clippy:45 if: ${{ false }}46 runs-on: self-hosted-ci47 48 steps:49 - name: Skip if pull request is in Draft50 # `if: github.event.pull_request.draft == true` should be kept here, at51 # the step level, rather than at the job level. The latter is not52 # recommended because when the PR is moved from "Draft" to "Ready to53 # review" the workflow will immediately be passing (since it was skipped),54 # even though it hasn't actually ran, since it takes a few seconds for55 # the workflow to start. This is also disclosed in:56 # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/1757 # That scenario would open an opportunity for the check to be bypassed:58 # 1. Get your PR approved59 # 2. Move it to Draft60 # 3. Push whatever commits you want61 # 4. Move it to "Ready for review"; now the workflow is passing (it was62 # skipped) and "Check reviews" is also passing (it won't be updated63 # until the workflow is finished)64 if: github.event.pull_request.draft == true65 run: exit 166 67 - uses: actions/checkout@v368 - name: Install substrate dependencies69 run: sudo apt-get install libssl-dev pkg-config libclang-dev clang70 - name: Install latest nightly71 uses: actions-rs/toolchain@v172 with:73 toolchain: nightly74 default: true75 target: wasm32-unknown-unknown76 components: rustfmt, clippy77 - name: Run cargo check78 run: cargo clippy -- -Dwarningsdifftreelog
source
.github/workflows/codestyle_v2.yml3.2 KiBsourcehistory