1name: Code style23on:4 pull_request:5 branches:6 - develop7 types:8 - opened9 - reopened10 - synchronize11 - ready_for_review1213jobs:14 rustfmt:15 runs-on: self-hosted-ci1617 steps:18 - name: Skip if pull request is in Draft19 # `if: github.event.pull_request.draft == true` should be kept here, at20 # the step level, rather than at the job level. The latter is not21 # recommended because when the PR is moved from "Draft" to "Ready to22 # review" the workflow will immediately be passing (since it was skipped),23 # even though it hasn't actually ran, since it takes a few seconds for24 # the workflow to start. This is also disclosed in:25 # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/1726 # That scenario would open an opportunity for the check to be bypassed:27 # 1. Get your PR approved28 # 2. Move it to Draft29 # 3. Push whatever commits you want30 # 4. Move it to "Ready for review"; now the workflow is passing (it was31 # skipped) and "Check reviews" is also passing (it won't be updated32 # until the workflow is finished)33 if: github.event.pull_request.draft == true34 run: exit 13536 - uses: actions/checkout@v137 - name: Install latest nightly38 uses: actions-rs/toolchain@v139 with:40 toolchain: nightly41 default: true42 target: wasm32-unknown-unknown43 components: rustfmt, clippy44 - name: Run cargo fmt45 run: cargo fmt -- --check4647 clippy:48 if: ${{ false }}49 runs-on: self-hosted-ci5051 steps:52 - name: Skip if pull request is in Draft53 # `if: github.event.pull_request.draft == true` should be kept here, at54 # the step level, rather than at the job level. The latter is not55 # recommended because when the PR is moved from "Draft" to "Ready to56 # review" the workflow will immediately be passing (since it was skipped),57 # even though it hasn't actually ran, since it takes a few seconds for58 # the workflow to start. This is also disclosed in:59 # https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/1760 # That scenario would open an opportunity for the check to be bypassed:61 # 1. Get your PR approved62 # 2. Move it to Draft63 # 3. Push whatever commits you want64 # 4. Move it to "Ready for review"; now the workflow is passing (it was65 # skipped) and "Check reviews" is also passing (it won't be updated66 # until the workflow is finished)67 if: github.event.pull_request.draft == true68 run: exit 169 70 - uses: actions/checkout@v371 - name: Install substrate dependencies72 run: sudo apt-get install libssl-dev pkg-config libclang-dev clang73 - name: Install latest nightly74 uses: actions-rs/toolchain@v175 with:76 toolchain: nightly77 default: true78 target: wasm32-unknown-unknown79 components: rustfmt, clippy80 - name: Run cargo check81 run: cargo clippy -- -Dwarningsdifftreelog
source
.github/workflows/codestyle.yml3.1 KiBsourcehistory