ratatui/.github/workflows/ci.yml

161 lines
4.5 KiB
YAML
Raw Normal View History

name: Continuous Integration
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
merge_group:
# ensure that the workflow is only triggered once per PR, subsequent pushes to the PR will cancel
# and restart the workflow. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
2019-11-05 08:24:14 +01:00
# lint, clippy and coverage jobs are intentionally early in the workflow to catch simple formatting,
# typos, and missing tests as early as possible. This allows us to fix these and resubmit the PR
# without having to wait for the comprehensive matrix of tests to complete.
2019-11-05 08:24:14 +01:00
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo +nightly fmt --all --check
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
chore(deps): bump EmbarkStudios/cargo-deny-action from 1 to 2 (#1296) Bumps [EmbarkStudios/cargo-deny-action](https://github.com/embarkstudios/cargo-deny-action) from 1 to 2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/embarkstudios/cargo-deny-action/releases">EmbarkStudios/cargo-deny-action's releases</a>.</em></p> <blockquote> <h2>Release 2.0.1 - cargo-deny 0.16.1</h2> <h3>Fixed</h3> <ul> <li><a href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/691">PR#691</a> fixed an issue where workspace dependencies that used the current dir '.' path component would incorrectly trigger the <code>unused-workspace-dependency</code> lint.</li> </ul> <h2>Release 2.0.0 - cargo-deny 0.16.0</h2> <h2><code>Action</code></h2> <h3>Added</h3> <ul> <li><a href="https://redirect.github.com/EmbarkStudios/cargo-deny-action/pull/78">PR#78</a> added SSH support, thanks <a href="https://github.com/nagua"><code>@​nagua</code></a>!</li> </ul> <h3>Changed</h3> <ul> <li>This release includes breaking changes in cargo-deny, so this release begins the <code>v2</code> tag, using <code>v1</code> will be stable but not follow future <code>cargo-deny</code> releases.</li> </ul> <h2><code>cargo-deny</code></h2> <h3>Removed</h3> <ul> <li><a href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/681">PR#681</a> finished the deprecation introduced in <a href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/611">PR#611</a>, making the usage of the deprecated fields into errors.</li> </ul> <h4><code>[advisories]</code></h4> <p>The following fields have all been removed in favor of denying all advisories by default. To ignore an advisory the <a href="https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html#the-ignore-field-optional"><code>ignore</code></a> field can be used as before.</p> <ul> <li><code>vulnerability</code> - Vulnerability advisories are now <code>deny</code> by default</li> <li><code>unmaintained</code> - Unmaintained advisories are now <code>deny</code> by default</li> <li><code>unsound</code> - Unsound advisories are now <code>deny</code> by default</li> <li><code>notice</code> - Notice advisories are now <code>deny</code> by default</li> <li><code>severity-threshold</code> - The severity of vulnerabilities is now irrelevant</li> </ul> <h4><code>[licenses]</code></h4> <p>The following fields have all been removed in favor of denying all licenses that are not explicitly allowed via either <a href="https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html#the-allow-field-optional"><code>allow</code></a> or <a href="https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html#the-exceptions-field-optional"><code>exceptions</code></a>.</p> <ul> <li><code>unlicensed</code> - Crates whose license(s) cannot be confidently determined are now always errors. The <a href="https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html#the-clarify-field-optional"><code>clarify</code></a> field can be used to help cargo-deny determine the license.</li> <li><code>allow-osi-fsf-free</code> - The OSI/FSF Free attributes are now irrelevant, only whether it is explicitly allowed.</li> <li><code>copyleft</code> - The copyleft attribute is now irrelevant, only whether it is explicitly allowed.</li> <li><code>default</code> - The default is now <code>deny</code>.</li> <li><code>deny</code> - All licenses are now denied by default, this field added nothing.</li> </ul> <h3>Changed</h3> <ul> <li><a href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/685">PR#685</a> follows up on <a href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/673">PR#673</a>, moving the fields that were added to their own separate <a href="https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html#the-workspace-dependencies-field-optional"><code>bans.workspace-dependencies</code></a> section. This is an unannounced breaking change but is fairly minor and 0.15.0 was never released on github actions so the amount of people affected by this will be (hopefully) small. This also makes the workspace duplicate detection off by default since the field is optional, <em>but</em> makes it so that if not specified workspace duplicates are now <code>deny</code> instead of <code>warn</code>.</li> </ul> <h3>Fixed</h3> <ul> <li><a href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/685">PR#685</a> resolved <a href="https://redirect.github.com/EmbarkStudios/cargo-deny/issues/682">#682</a> by adding the <code>include-path-dependencies</code> field, allowing path dependencies to be ignored if it is <code>false</code>.</li> </ul> <h2>Release 1.6.3 - cargo-deny 0.14.21</h2> <h3>Fixed</h3> <ul> <li><a href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/643">PR#643</a> resolved <a href="https://redirect.github.com/EmbarkStudios/cargo-deny/issues/629">#629</a> by making the hosted git (github, gitlab, bitbucket) org/user name comparison case-insensitive. Thanks <a href="https://github.com/pmnlla"><code>@​pmnlla</code></a>!</li> <li><a href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/649">PR#649</a> fixed an issue where depending on the same crate multiple times by using different <code>cfg()/triple</code> targets could cause features to be resolved incorrectly and thus crates to be not pulled into the graph used for checking.</li> </ul> <h2>[0.14.20] - 2024-03-23</h2> <h3>Fixed</h3> <ul> <li><a href="https://redirect.github.com/EmbarkStudios/cargo-deny/pull/642">PR#642</a> resolved <a href="https://redirect.github.com/EmbarkStudios/cargo-deny/issues/641">#641</a> by pinning <code>gix-transport</code> (and its unique dependencies) to 0.41.2 as a workaround for <code>cargo install</code> not using the lockfile. See <a href="https://redirect.github.com/Byron/gitoxide/issues/1328">this issue</a> for more information.</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/EmbarkStudios/cargo-deny-action/commit/8371184bd11e21dcf8ac82ebf8c9c9f74ebf7268"><code>8371184</code></a> Bump to 0.16.1</li> <li><a href="https://github.com/EmbarkStudios/cargo-deny-action/commit/08954043da4788e6bfee86331d3146114c2fa0c6"><code>0895404</code></a> Move to v2 tag</li> <li><a href="https://github.com/EmbarkStudios/cargo-deny-action/commit/10d8902cf9225c404574ce39c45d5d26c3047464"><code>10d8902</code></a> Bump to 0.16.0</li> <li><a href="https://github.com/EmbarkStudios/cargo-deny-action/commit/d425dbf412a3af2ca185c2f641a1ed349c5193e4"><code>d425dbf</code></a> Update .gitignore</li> <li><a href="https://github.com/EmbarkStudios/cargo-deny-action/commit/53bface5b18b22eaf73aff53abda18ead1e9ef98"><code>53bface</code></a> Update image base</li> <li><a href="https://github.com/EmbarkStudios/cargo-deny-action/commit/3f8dc3eed75398519a06f6a0b9dd5db5f833dd74"><code>3f8dc3e</code></a> Add ability to fetch git dependecies in cargo via ssh (<a href="https://redirect.github.com/embarkstudios/cargo-deny-action/issues/78">#78</a>)</li> <li>See full diff in <a href="https://github.com/embarkstudios/cargo-deny-action/compare/v1...v2">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=EmbarkStudios/cargo-deny-action&package-manager=github_actions&previous-version=1&new-version=2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 19:18:21 +03:00
- uses: EmbarkStudios/cargo-deny-action@v2
cargo-machete:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: bnjbvr/cargo-machete@v0.6.2
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: taiki-e/install-action@cargo-make
- uses: Swatinem/rust-cache@v2
- run: cargo make clippy
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: |
'**/*.md'
'!target'
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools
- uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov,cargo-make
- uses: Swatinem/rust-cache@v2
- run: cargo make coverage
- uses: codecov/codecov-action@v4
with:
2023-07-27 23:57:53 -07:00
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
check:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain: ["1.74.0", "stable"]
2023-02-17 20:59:18 +09:00
runs-on: ${{ matrix.os }}
2019-11-05 08:24:14 +01:00
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- uses: taiki-e/install-action@cargo-make
- uses: Swatinem/rust-cache@v2
- run: cargo make check
env:
RUST_BACKTRACE: full
lint-docs:
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- uses: Swatinem/rust-cache@v2
# Run cargo rustdoc with the same options that would be used by docs.rs, taking into account
# the package.metadata.docs.rs configured in Cargo.toml.
# https://github.com/dtolnay/cargo-docs-rs
- run: cargo +nightly docs-rs
test-doc:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-make
- uses: Swatinem/rust-cache@v2
- run: cargo make test-doc
env:
RUST_BACKTRACE: full
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain: ["1.74.0", "stable"]
backend: [crossterm, termion, termwiz]
exclude:
# termion is not supported on windows
- os: windows-latest
backend: termion
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- uses: taiki-e/install-action@v2
with:
tool: cargo-make,nextest
- uses: Swatinem/rust-cache@v2
- run: cargo make test-backend ${{ matrix.backend }}
env:
RUST_BACKTRACE: full