diff options
| author | Felipe Balbi <[email protected]> | 2025-11-07 11:00:15 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-11-07 11:00:15 -0800 |
| commit | 5632acec18cc5906b1625a8facf530db56c73300 (patch) | |
| tree | abf2897f4b2f9814069c64611896be2d42cf2ce8 /.github | |
| parent | 47e383545f4aac3bfaec0563429cc721540e665a (diff) | |
| parent | 9590d94ee9ba016f65a13100c429fc56ffe58e40 (diff) | |
Merge pull request #1 from bogdan-petru/import/mcxa276-initial
feat(mcxa276): initial HAL import
Diffstat (limited to '.github')
| -rw-r--r-- | .github/DOCS.md | 23 | ||||
| -rw-r--r-- | .github/codecov.yml | 21 | ||||
| -rw-r--r-- | .github/dependabot.yml | 19 | ||||
| -rw-r--r-- | .github/workflows/check.yml | 106 | ||||
| -rw-r--r-- | .github/workflows/nostd.yml | 17 | ||||
| -rw-r--r-- | .github/workflows/rolling.yml | 68 |
6 files changed, 217 insertions, 37 deletions
diff --git a/.github/DOCS.md b/.github/DOCS.md new file mode 100644 index 000000000..e932784c7 --- /dev/null +++ b/.github/DOCS.md | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | # Github config and workflows | ||
| 2 | |||
| 3 | In this folder there is configuration for codecoverage, dependabot, and ci | ||
| 4 | workflows that check the library more deeply than the default configurations. | ||
| 5 | |||
| 6 | This folder can be or was merged using a --allow-unrelated-histories merge | ||
| 7 | strategy from <https://github.com/jonhoo/rust-ci-conf/> which provides a | ||
| 8 | reasonably sensible base for writing your own ci on. By using this strategy | ||
| 9 | the history of the CI repo is included in your repo, and future updates to | ||
| 10 | the CI can be merged later. | ||
| 11 | |||
| 12 | To perform this merge run: | ||
| 13 | |||
| 14 | ```shell | ||
| 15 | git remote add ci https://github.com/jonhoo/rust-ci-conf.git | ||
| 16 | git fetch ci | ||
| 17 | git merge --allow-unrelated-histories ci/main | ||
| 18 | ``` | ||
| 19 | |||
| 20 | An overview of the files in this project is available at: | ||
| 21 | <https://www.youtube.com/watch?v=xUH-4y92jPg&t=491s>, which contains some | ||
| 22 | rationale for decisions and runs through an example of solving minimal version | ||
| 23 | and OpenSSL issues. | ||
diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 000000000..cd5ce8fc1 --- /dev/null +++ b/.github/codecov.yml | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | # ref: https://docs.codecov.com/docs/codecovyml-reference | ||
| 2 | coverage: | ||
| 3 | # Hold ourselves to a high bar | ||
| 4 | range: 85..100 | ||
| 5 | round: down | ||
| 6 | precision: 1 | ||
| 7 | status: | ||
| 8 | # ref: https://docs.codecov.com/docs/commit-status | ||
| 9 | project: | ||
| 10 | default: | ||
| 11 | # Avoid false negatives | ||
| 12 | threshold: 1% | ||
| 13 | |||
| 14 | # Test files aren't important for coverage | ||
| 15 | ignore: | ||
| 16 | - "tests" | ||
| 17 | |||
| 18 | # Make comments less noisy | ||
| 19 | comment: | ||
| 20 | layout: "files" | ||
| 21 | require_changes: true | ||
diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..d0f091e7b --- /dev/null +++ b/.github/dependabot.yml | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | version: 2 | ||
| 2 | updates: | ||
| 3 | - package-ecosystem: github-actions | ||
| 4 | directory: / | ||
| 5 | schedule: | ||
| 6 | interval: daily | ||
| 7 | - package-ecosystem: cargo | ||
| 8 | directory: / | ||
| 9 | schedule: | ||
| 10 | interval: daily | ||
| 11 | ignore: | ||
| 12 | - dependency-name: "*" | ||
| 13 | # patch and minor updates don't matter for libraries as consumers of this library build | ||
| 14 | # with their own lockfile, rather than the version specified in this library's lockfile | ||
| 15 | # remove this ignore rule if your package has binaries to ensure that the binaries are | ||
| 16 | # built with the exact set of dependencies and those are up to date. | ||
| 17 | update-types: | ||
| 18 | - "version-update:semver-patch" | ||
| 19 | - "version-update:semver-minor" | ||
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9bf402d61..1a09a1492 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | # This workflow runs whenever a PR is opened or updated, or a commit is pushed to main. It runs | 1 | # This workflow runs whenever a PR is opened or updated, or a commit is pushed to main. It runs |
| 2 | # several checks: | 2 | # several checks: |
| 3 | # - commit_list: produces a list of commits to be checked | ||
| 4 | # - fmt: checks that the code is formatted according to rustfmt | 3 | # - fmt: checks that the code is formatted according to rustfmt |
| 5 | # - clippy: checks that the code does not contain any clippy warnings | 4 | # - clippy: checks that the code does not contain any clippy warnings |
| 6 | # - doc: checks that the code can be documented without errors | 5 | # - doc: checks that the code can be documented without errors |
| @@ -8,66 +7,84 @@ | |||
| 8 | # - msrv: check that the msrv specified in the crate is correct | 7 | # - msrv: check that the msrv specified in the crate is correct |
| 9 | permissions: | 8 | permissions: |
| 10 | contents: read | 9 | contents: read |
| 10 | |||
| 11 | # This configuration allows maintainers of this repo to create a branch and pull request based on | 11 | # This configuration allows maintainers of this repo to create a branch and pull request based on |
| 12 | # the new branch. Restricting the push trigger to the main branch ensures that the PR only gets | 12 | # the new branch. Restricting the push trigger to the main branch ensures that the PR only gets |
| 13 | # built once. | 13 | # built once. |
| 14 | on: | 14 | on: |
| 15 | |||
| 15 | push: | 16 | push: |
| 16 | branches: [main] | 17 | branches: [main, main-nextgen] |
| 17 | pull_request: | 18 | pull_request: |
| 19 | |||
| 18 | # If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that | 20 | # If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that |
| 19 | # we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5 | 21 | # we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5 |
| 20 | concurrency: | 22 | concurrency: |
| 21 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | 23 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 22 | cancel-in-progress: true | 24 | cancel-in-progress: true |
| 25 | |||
| 23 | name: check | 26 | name: check |
| 27 | |||
| 24 | jobs: | 28 | jobs: |
| 29 | |||
| 25 | fmt: | 30 | fmt: |
| 26 | runs-on: ubuntu-latest | 31 | runs-on: ubuntu-latest |
| 27 | name: stable / fmt | 32 | name: nightly / fmt |
| 33 | |||
| 34 | strategy: | ||
| 35 | fail-fast: false | ||
| 36 | matrix: | ||
| 37 | workdir: [ ".", "examples/rt633", "examples/rt685s-evk",] | ||
| 38 | |||
| 28 | steps: | 39 | steps: |
| 29 | - uses: actions/checkout@v4 | 40 | - uses: actions/checkout@v4 |
| 30 | with: | 41 | with: |
| 31 | submodules: true | 42 | submodules: true |
| 32 | - name: Install stable | 43 | |
| 33 | uses: dtolnay/rust-toolchain@stable | 44 | - name: Install nightly |
| 45 | uses: dtolnay/rust-toolchain@nightly | ||
| 34 | with: | 46 | with: |
| 35 | components: rustfmt | 47 | components: rustfmt |
| 48 | |||
| 36 | - name: cargo fmt --check | 49 | - name: cargo fmt --check |
| 37 | run: cargo fmt --check | 50 | run: cargo fmt --check |
| 51 | working-directory: ${{ matrix.workdir }} | ||
| 38 | 52 | ||
| 39 | clippy: | 53 | clippy-examples: |
| 40 | runs-on: ubuntu-latest | 54 | runs-on: ubuntu-latest |
| 41 | name: ${{ matrix.toolchain }} / clippy | 55 | name: ${{ matrix.toolchain }} / clippy |
| 56 | |||
| 42 | permissions: | 57 | permissions: |
| 43 | contents: read | 58 | contents: read |
| 44 | checks: write | 59 | checks: write |
| 60 | |||
| 45 | strategy: | 61 | strategy: |
| 46 | fail-fast: false | 62 | fail-fast: false |
| 47 | matrix: | 63 | matrix: |
| 48 | # Get early warning of new lints which are regularly introduced in beta channels. | 64 | # Get early warning of new lints which are regularly introduced in beta channels. |
| 49 | toolchain: [stable, beta] | 65 | toolchain: [stable] |
| 66 | workdir: ["examples"] | ||
| 67 | |||
| 50 | steps: | 68 | steps: |
| 51 | - uses: actions/checkout@v4 | 69 | - uses: actions/checkout@v4 |
| 52 | with: | 70 | with: |
| 53 | submodules: true | 71 | submodules: true |
| 72 | |||
| 54 | - name: Install ${{ matrix.toolchain }} | 73 | - name: Install ${{ matrix.toolchain }} |
| 55 | uses: dtolnay/rust-toolchain@master | 74 | uses: dtolnay/rust-toolchain@master |
| 56 | with: | 75 | with: |
| 57 | toolchain: ${{ matrix.toolchain }} | 76 | toolchain: ${{ matrix.toolchain }} |
| 58 | components: clippy | 77 | components: clippy |
| 78 | |||
| 59 | - name: cargo clippy | 79 | - name: cargo clippy |
| 60 | uses: giraffate/clippy-action@v1 | 80 | working-directory: ${{ matrix.workdir }} |
| 61 | with: | 81 | run: | |
| 62 | reporter: 'github-pr-check' | 82 | cargo clippy --locked -- -Dwarnings -D clippy::suspicious -D clippy::correctness -D clippy::perf -D clippy::style |
| 63 | github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| 64 | 83 | ||
| 65 | # Enable once we have a released crate | 84 | # Enable once we have a released crate |
| 66 | # semver: | 85 | # semver: |
| 67 | # runs-on: ubuntu-latest | 86 | # runs-on: ubuntu-latest |
| 68 | # name: semver | 87 | # name: semver |
| 69 | # strategy: | ||
| 70 | # fail-fast: false | ||
| 71 | # steps: | 88 | # steps: |
| 72 | # - uses: actions/checkout@v4 | 89 | # - uses: actions/checkout@v4 |
| 73 | # with: | 90 | # with: |
| @@ -85,14 +102,18 @@ jobs: | |||
| 85 | # API be documented as only available in some specific platforms. | 102 | # API be documented as only available in some specific platforms. |
| 86 | runs-on: ubuntu-latest | 103 | runs-on: ubuntu-latest |
| 87 | name: nightly / doc | 104 | name: nightly / doc |
| 105 | |||
| 88 | steps: | 106 | steps: |
| 89 | - uses: actions/checkout@v4 | 107 | - uses: actions/checkout@v4 |
| 90 | with: | 108 | with: |
| 91 | submodules: true | 109 | submodules: true |
| 110 | |||
| 92 | - name: Install nightly | 111 | - name: Install nightly |
| 93 | uses: dtolnay/rust-toolchain@nightly | 112 | uses: dtolnay/rust-toolchain@nightly |
| 113 | |||
| 94 | - name: cargo doc | 114 | - name: cargo doc |
| 95 | run: cargo doc --no-deps --all-features | 115 | run: | |
| 116 | cargo doc --no-deps --all-features --locked | ||
| 96 | env: | 117 | env: |
| 97 | RUSTDOCFLAGS: --cfg docsrs | 118 | RUSTDOCFLAGS: --cfg docsrs |
| 98 | 119 | ||
| @@ -101,16 +122,24 @@ jobs: | |||
| 101 | # which is required for feature unification | 122 | # which is required for feature unification |
| 102 | runs-on: ubuntu-latest | 123 | runs-on: ubuntu-latest |
| 103 | name: ubuntu / stable / features | 124 | name: ubuntu / stable / features |
| 125 | |||
| 126 | strategy: | ||
| 127 | fail-fast: false | ||
| 128 | |||
| 104 | steps: | 129 | steps: |
| 105 | - uses: actions/checkout@v4 | 130 | - uses: actions/checkout@v4 |
| 106 | with: | 131 | with: |
| 107 | submodules: true | 132 | submodules: true |
| 133 | |||
| 108 | - name: Install stable | 134 | - name: Install stable |
| 109 | uses: dtolnay/rust-toolchain@stable | 135 | uses: dtolnay/rust-toolchain@stable |
| 110 | - name: cargo install cargo-hack | 136 | with: |
| 111 | uses: taiki-e/install-action@cargo-hack | 137 | toolchain: stable |
| 112 | # intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4 | 138 | components: clippy |
| 113 | # --feature-powerset runs for every combination of features | 139 | |
| 140 | - name: rustup target add thumbv8m.main-none-eabihf | ||
| 141 | run: rustup target add thumbv8m.main-none-eabihf | ||
| 142 | |||
| 114 | - name: cargo hack | 143 | - name: cargo hack |
| 115 | run: cargo hack --feature-powerset check | 144 | run: cargo hack --feature-powerset check |
| 116 | 145 | ||
| @@ -119,33 +148,22 @@ jobs: | |||
| 119 | # our dependencies. | 148 | # our dependencies. |
| 120 | runs-on: ubuntu-latest | 149 | runs-on: ubuntu-latest |
| 121 | name: ubuntu / stable / deny | 150 | name: ubuntu / stable / deny |
| 151 | |||
| 122 | steps: | 152 | steps: |
| 123 | - uses: actions/checkout@v4 | 153 | - uses: actions/checkout@v4 |
| 124 | with: | 154 | with: |
| 125 | submodules: true | 155 | submodules: true |
| 156 | |||
| 126 | - name: Install stable | 157 | - name: Install stable |
| 127 | uses: dtolnay/rust-toolchain@stable | 158 | uses: dtolnay/rust-toolchain@stable |
| 159 | |||
| 128 | - name: cargo install cargo-deny | 160 | - name: cargo install cargo-deny |
| 129 | uses: EmbarkStudios/cargo-deny-action@v2 | 161 | uses: EmbarkStudios/cargo-deny-action@v2 |
| 130 | with: | 162 | with: |
| 131 | log-level: warn | 163 | log-level: warn |
| 132 | manifest-path: ./Cargo.toml | 164 | manifest-path: ./Cargo.toml |
| 133 | command: check | 165 | command: check |
| 134 | arguments: --all-features | 166 | arguments: --all-features --locked |
| 135 | |||
| 136 | test: | ||
| 137 | runs-on: ubuntu-latest | ||
| 138 | name: ubuntu / stable / test | ||
| 139 | steps: | ||
| 140 | - uses: actions/checkout@v4 | ||
| 141 | with: | ||
| 142 | submodules: true | ||
| 143 | - name: Install stable | ||
| 144 | uses: dtolnay/rust-toolchain@stable | ||
| 145 | - name: cargo install cargo-hack | ||
| 146 | uses: taiki-e/install-action@cargo-hack | ||
| 147 | - name: cargo test | ||
| 148 | run: cargo hack --feature-powerset test | ||
| 149 | 167 | ||
| 150 | msrv: | 168 | msrv: |
| 151 | # check that we can build using the minimal rust version that is specified by this crate | 169 | # check that we can build using the minimal rust version that is specified by this crate |
| @@ -155,15 +173,33 @@ jobs: | |||
| 155 | strategy: | 173 | strategy: |
| 156 | fail-fast: false | 174 | fail-fast: false |
| 157 | matrix: | 175 | matrix: |
| 158 | msrv: ["1.85"] | 176 | msrv: ["1.90"] # We're relying on namespaced-features, which |
| 177 | # was released in 1.60 | ||
| 178 | # | ||
| 179 | # We also depend on `fixed' which requires rust | ||
| 180 | # 1.71 | ||
| 181 | # | ||
| 182 | # Additionally, we depend on embedded-hal-async | ||
| 183 | # which requires 1.75 | ||
| 184 | # | ||
| 185 | # embassy-time requires 1.79 due to | ||
| 186 | # collapse_debuginfo | ||
| 187 | # | ||
| 188 | # embassy upstream switched to rust 1.85 | ||
| 189 | # | ||
| 190 | # unsigned_is_multiple_of requires 1.90, else we get clippy warnings | ||
| 191 | |||
| 159 | name: ubuntu / ${{ matrix.msrv }} | 192 | name: ubuntu / ${{ matrix.msrv }} |
| 160 | steps: | 193 | steps: |
| 161 | - uses: actions/checkout@v4 | 194 | - uses: actions/checkout@v4 |
| 162 | with: | 195 | with: |
| 163 | submodules: true | 196 | submodules: true |
| 197 | |||
| 164 | - name: Install ${{ matrix.msrv }} | 198 | - name: Install ${{ matrix.msrv }} |
| 165 | uses: dtolnay/rust-toolchain@master | 199 | uses: dtolnay/rust-toolchain@master |
| 166 | with: | 200 | with: |
| 167 | toolchain: ${{ matrix.msrv }} | 201 | toolchain: ${{ matrix.msrv }} |
| 202 | |||
| 168 | - name: cargo +${{ matrix.msrv }} check | 203 | - name: cargo +${{ matrix.msrv }} check |
| 169 | run: cargo check | 204 | run: | |
| 205 | cargo check --all-features --locked | ||
diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml index 532235851..92460bd0f 100644 --- a/.github/workflows/nostd.yml +++ b/.github/workflows/nostd.yml | |||
| @@ -3,28 +3,41 @@ | |||
| 3 | # information about how the concurrency cancellation and workflow triggering works | 3 | # information about how the concurrency cancellation and workflow triggering works |
| 4 | permissions: | 4 | permissions: |
| 5 | contents: read | 5 | contents: read |
| 6 | |||
| 6 | on: | 7 | on: |
| 7 | push: | 8 | push: |
| 8 | branches: [main] | 9 | branches: [main, main-nextgen] |
| 9 | pull_request: | 10 | pull_request: |
| 11 | |||
| 10 | concurrency: | 12 | concurrency: |
| 11 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | 13 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 12 | cancel-in-progress: true | 14 | cancel-in-progress: true |
| 15 | |||
| 13 | name: no-std | 16 | name: no-std |
| 17 | |||
| 14 | jobs: | 18 | jobs: |
| 15 | nostd: | 19 | nostd: |
| 16 | runs-on: ubuntu-latest | 20 | runs-on: ubuntu-latest |
| 17 | name: ${{ matrix.target }} | 21 | name: ${{ matrix.target }} |
| 22 | |||
| 18 | strategy: | 23 | strategy: |
| 19 | matrix: | 24 | matrix: |
| 20 | target: [thumbv8m.main-none-eabihf] | 25 | target: [thumbv8m.main-none-eabihf] |
| 26 | |||
| 21 | steps: | 27 | steps: |
| 22 | - uses: actions/checkout@v4 | 28 | - uses: actions/checkout@v4 |
| 23 | with: | 29 | with: |
| 24 | submodules: true | 30 | submodules: true |
| 31 | |||
| 25 | - name: Install stable | 32 | - name: Install stable |
| 26 | uses: dtolnay/rust-toolchain@stable | 33 | uses: dtolnay/rust-toolchain@stable |
| 34 | |||
| 27 | - name: rustup target add ${{ matrix.target }} | 35 | - name: rustup target add ${{ matrix.target }} |
| 28 | run: rustup target add ${{ matrix.target }} | 36 | run: rustup target add ${{ matrix.target }} |
| 37 | |||
| 38 | - name: Show variable | ||
| 39 | run: echo ${{ env.TOKEN }} | ||
| 40 | |||
| 29 | - name: cargo check | 41 | - name: cargo check |
| 30 | run: cargo check --target ${{ matrix.target }} | 42 | run: | |
| 43 | cargo check --target ${{ matrix.target }} --all-features --locked | ||
diff --git a/.github/workflows/rolling.yml b/.github/workflows/rolling.yml new file mode 100644 index 000000000..f572954f9 --- /dev/null +++ b/.github/workflows/rolling.yml | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | # This workflow runs every morning at midnight. It will run cargo hack | ||
| 2 | # and a build with msrv. If any dependency breaks our crate, we will | ||
| 3 | # know ASAP. | ||
| 4 | # | ||
| 5 | # - check: build with all features | ||
| 6 | # - msrv: check that the msrv specified in the crate is correct | ||
| 7 | permissions: | ||
| 8 | contents: read | ||
| 9 | |||
| 10 | on: | ||
| 11 | schedule: | ||
| 12 | - cron: '0 0 * * *' | ||
| 13 | |||
| 14 | name: rolling | ||
| 15 | jobs: | ||
| 16 | |||
| 17 | check: | ||
| 18 | runs-on: ubuntu-latest | ||
| 19 | name: ubuntu / stable / features | ||
| 20 | strategy: | ||
| 21 | fail-fast: false | ||
| 22 | steps: | ||
| 23 | - uses: actions/checkout@v4 | ||
| 24 | with: | ||
| 25 | submodules: true | ||
| 26 | - name: Install stable | ||
| 27 | uses: dtolnay/rust-toolchain@stable | ||
| 28 | - name: cargo install cargo-hack | ||
| 29 | uses: taiki-e/install-action@cargo-hack | ||
| 30 | - name: cargo check | ||
| 31 | run: | | ||
| 32 | cargo update | ||
| 33 | cargo check --all-features check | ||
| 34 | |||
| 35 | msrv: | ||
| 36 | runs-on: ubuntu-latest | ||
| 37 | strategy: | ||
| 38 | fail-fast: false | ||
| 39 | matrix: | ||
| 40 | msrv: ["1.85"] # We're relying on namespaced-features, which | ||
| 41 | # was released in 1.60 | ||
| 42 | # | ||
| 43 | # We also depend on `fixed' which requires rust | ||
| 44 | # 1.71 | ||
| 45 | # | ||
| 46 | # Additionally, we depend on embedded-hal-async | ||
| 47 | # which requires 1.75 | ||
| 48 | # | ||
| 49 | # embassy-time requires 1.79 due to | ||
| 50 | # collapse_debuginfo | ||
| 51 | # | ||
| 52 | # embassy upstream switched to rust 1.83 | ||
| 53 | # | ||
| 54 | # embedded-services (storage bus) dependency | ||
| 55 | # requires 1.85 | ||
| 56 | name: ubuntu / ${{ matrix.msrv }} (${{ matrix.commit }}) | ||
| 57 | steps: | ||
| 58 | - uses: actions/checkout@v4 | ||
| 59 | with: | ||
| 60 | submodules: true | ||
| 61 | - name: Install ${{ matrix.msrv }} | ||
| 62 | uses: dtolnay/rust-toolchain@master | ||
| 63 | with: | ||
| 64 | toolchain: ${{ matrix.msrv }} | ||
| 65 | - name: cargo +${{ matrix.msrv }} check | ||
| 66 | run: | | ||
| 67 | cargo update | ||
| 68 | cargo check --all-features check | ||
