|
| 1 | +# Adapted from jonhoo/rust-ci-conf |
| 2 | +# Original source: https://github.com/jonhoo/rust-ci-conf/commit/fabb82abd53e0052c8b70ae197a80e6203ede26d |
| 3 | +# Original license: MIT OR Apache2.0 (https://github.com/jonhoo/rust-ci-conf/issues/6) |
| 4 | + |
| 5 | +# Edit notes: |
| 6 | +# - removed separate clippy job with corresponding report action |
| 7 | +# - remove semver, doc and hack as these checks are less useful to this binary crate |
| 8 | + |
| 9 | +# This workflow runs whenever a PR is opened or updated, or a commit is pushed to main or develop. |
| 10 | +# It runs several checks: |
| 11 | +# - customs: checks most things |
| 12 | +# and additionally the things not handled by customs: |
| 13 | +# - fmt: checks that the code is formatted according to rustfmt |
| 14 | +permissions: |
| 15 | + contents: read |
| 16 | +# This configuration allows maintainers of this repo to create a branch and pull request based on |
| 17 | +# the new branch. Restricting the push trigger to the main branch ensures that the PR only gets |
| 18 | +# built once. |
| 19 | +on: |
| 20 | + push: |
| 21 | + branches: [main, develop] |
| 22 | + pull_request: |
| 23 | +# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that |
| 24 | +# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5 |
| 25 | +concurrency: |
| 26 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 27 | + cancel-in-progress: true |
| 28 | +name: check |
| 29 | +jobs: |
| 30 | + fmt: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + name: stable / fmt |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + with: |
| 36 | + submodules: true |
| 37 | + - name: Install stable |
| 38 | + uses: dtolnay/rust-toolchain@stable |
| 39 | + with: |
| 40 | + components: rustfmt |
| 41 | + - name: cargo fmt --check |
| 42 | + run: cargo fmt --check |
| 43 | + customs: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + name: stable / customs |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v4 |
| 48 | + with: |
| 49 | + submodules: true |
| 50 | + - name: Install stable |
| 51 | + uses: dtolnay/rust-toolchain@stable |
| 52 | + with: |
| 53 | + components: rustfmt |
| 54 | + targets: thumbv7em-none-eabihf |
| 55 | + - name: install customs from the source it is supposed to check |
| 56 | + # For sure this won't bite us in the back! |
| 57 | + run: cargo install --path . |
| 58 | + - name: cargo customs |
| 59 | + run: cargo customs |
0 commit comments