mirror of
https://github.com/ratatui/ratatui.git
synced 2025-09-26 20:40:44 +00:00
ci: audit github workflows with zizmor (#1961)
Fixes https://github.com/ratatui/ratatui/issues/1950
This commit is contained in:
parent
6b3323fb10
commit
1f0c2ee18e
65
.github/workflows/check-pr.yml
vendored
65
.github/workflows/check-pr.yml
vendored
@ -1,6 +1,13 @@
|
|||||||
name: Check Pull Requests
|
name: Check Pull Requests
|
||||||
|
|
||||||
|
# Set the permissions of the github token to the minimum and only enable what is needed
|
||||||
|
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
# this workflow is required to be run on pull_request_target as it modifies the PR comments
|
||||||
|
# care should be taken that the jobs do not run any untrusted input
|
||||||
|
# zizmor: ignore[dangerous-triggers]
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
@ -8,23 +15,21 @@ on:
|
|||||||
- synchronize
|
- synchronize
|
||||||
- labeled
|
- labeled
|
||||||
- unlabeled
|
- unlabeled
|
||||||
merge_group:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-title:
|
check-title:
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check PR title
|
- name: Check PR title
|
||||||
if: github.event_name == 'pull_request_target'
|
if: github.event_name == 'pull_request_target'
|
||||||
uses: amannn/action-semantic-pull-request@v5
|
uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5
|
||||||
id: check_pr_title
|
id: check_pr_title
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# Add comment indicating we require pull request titles to follow conventional commits specification
|
# Add comment indicating we require pull request titles to follow conventional commits specification
|
||||||
- uses: marocchino/sticky-pull-request-comment@v2
|
- uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728 # v2
|
||||||
if: always() && (steps.check_pr_title.outputs.error_message != null)
|
if: always() && (steps.check_pr_title.outputs.error_message != null)
|
||||||
with:
|
with:
|
||||||
header: pr-title-lint-error
|
header: pr-title-lint-error
|
||||||
@ -39,40 +44,42 @@ jobs:
|
|||||||
|
|
||||||
# Delete a previous comment when the issue has been resolved
|
# Delete a previous comment when the issue has been resolved
|
||||||
- if: ${{ steps.check_pr_title.outputs.error_message == null }}
|
- if: ${{ steps.check_pr_title.outputs.error_message == null }}
|
||||||
uses: marocchino/sticky-pull-request-comment@v2
|
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728 # v2
|
||||||
with:
|
with:
|
||||||
header: pr-title-lint-error
|
header: pr-title-lint-error
|
||||||
delete: true
|
delete: true
|
||||||
|
|
||||||
check-breaking-change-label:
|
check-breaking-change-label:
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
# use an environment variable to pass untrusted input to the script
|
# use an environment variable to pass untrusted input to the script
|
||||||
# see https://securitylab.github.com/research/github-actions-untrusted-input/
|
# see https://securitylab.github.com/research/github-actions-untrusted-input/
|
||||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check breaking change label
|
- name: Check breaking change label
|
||||||
id: check_breaking_change
|
id: check_breaking_change
|
||||||
run: |
|
run: |
|
||||||
pattern='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!:'
|
pattern='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!:'
|
||||||
# Check if pattern matches
|
# Check if pattern matches
|
||||||
if echo "${PR_TITLE}" | grep -qE "$pattern"; then
|
if echo "${PR_TITLE}" | grep -qE "$pattern"; then
|
||||||
echo "breaking_change=true" >> $GITHUB_OUTPUT
|
echo "breaking_change=true" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "breaking_change=false" >> $GITHUB_OUTPUT
|
echo "breaking_change=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
- name: Add label
|
- name: Add label
|
||||||
if: steps.check_breaking_change.outputs.breaking_change == 'true'
|
if: steps.check_breaking_change.outputs.breaking_change == 'true'
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
github.rest.issues.addLabels({
|
github.rest.issues.addLabels({
|
||||||
issue_number: context.issue.number,
|
issue_number: context.issue.number,
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
labels: ['Type: Breaking Change']
|
labels: ['Type: Breaking Change']
|
||||||
})
|
})
|
||||||
|
|
||||||
do-not-merge:
|
do-not-merge:
|
||||||
if: ${{ contains(github.event.*.labels.*.name, 'do not merge') }}
|
if: ${{ contains(github.event.*.labels.*.name, 'do not merge') }}
|
||||||
|
10
.github/workflows/check-semver.yml
vendored
10
.github/workflows/check-semver.yml
vendored
@ -1,5 +1,9 @@
|
|||||||
name: Check Semver
|
name: Check Semver
|
||||||
|
|
||||||
|
# Set the permissions of the github token to the minimum and only enable what is needed
|
||||||
|
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
@ -11,6 +15,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
- name: Check semver
|
- name: Check semver
|
||||||
uses: obi1kenobi/cargo-semver-checks-action@v2
|
uses: obi1kenobi/cargo-semver-checks-action@5b298c9520f7096a4683c0bd981a7ac5a7e249ae # v2
|
||||||
|
142
.github/workflows/ci.yml
vendored
142
.github/workflows/ci.yml
vendored
@ -1,5 +1,9 @@
|
|||||||
name: Continuous Integration
|
name: Continuous Integration
|
||||||
|
|
||||||
|
# Set the permissions of the github token to the minimum and only enable what is needed
|
||||||
|
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Allows you to run this workflow manually from the Actions tab
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -25,11 +29,15 @@ jobs:
|
|||||||
name: Check Formatting
|
name: Check Formatting
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: dtolnay/rust-toolchain@nightly
|
with:
|
||||||
with: { components: rustfmt }
|
persist-credentials: false
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
- uses: taiki-e/install-action@v2
|
with:
|
||||||
|
toolchain: nightly
|
||||||
|
components: rustfmt
|
||||||
|
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
|
||||||
|
- uses: taiki-e/install-action@491d37bbaa844af8400b3595395e1bca723e6141 # v2
|
||||||
with:
|
with:
|
||||||
tool: taplo-cli
|
tool: taplo-cli
|
||||||
- run: cargo xtask format --check
|
- run: cargo xtask format --check
|
||||||
@ -40,8 +48,10 @@ jobs:
|
|||||||
name: Check Typos
|
name: Check Typos
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: crate-ci/typos@master
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: crate-ci/typos@392b78fe18a52790c53f42456e46124f77346842 # master
|
||||||
|
|
||||||
# Check for any disallowed dependencies in the codebase due to license / security issues.
|
# Check for any disallowed dependencies in the codebase due to license / security issues.
|
||||||
# See <https://github.com/EmbarkStudios/cargo-deny>
|
# See <https://github.com/EmbarkStudios/cargo-deny>
|
||||||
@ -49,9 +59,15 @@ jobs:
|
|||||||
name: Check Dependencies
|
name: Check Dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
with:
|
||||||
- uses: taiki-e/install-action@cargo-deny
|
persist-credentials: false
|
||||||
|
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
- uses: taiki-e/install-action@491d37bbaa844af8400b3595395e1bca723e6141 # v2
|
||||||
|
with:
|
||||||
|
tool: cargo-deny
|
||||||
- run: cargo deny --log-level info --all-features check
|
- run: cargo deny --log-level info --all-features check
|
||||||
|
|
||||||
# Check for any unused dependencies in the codebase.
|
# Check for any unused dependencies in the codebase.
|
||||||
@ -60,8 +76,10 @@ jobs:
|
|||||||
name: Check Unused Dependencies
|
name: Check Unused Dependencies
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: bnjbvr/cargo-machete@v0.8.0
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: bnjbvr/cargo-machete@b54422fa3319b3cac180f6030b663fe57af51635 # v0.8.0
|
||||||
|
|
||||||
# Run cargo clippy.
|
# Run cargo clippy.
|
||||||
#
|
#
|
||||||
@ -77,12 +95,14 @@ jobs:
|
|||||||
toolchain: ["stable", "beta"]
|
toolchain: ["stable", "beta"]
|
||||||
continue-on-error: ${{ matrix.toolchain == 'beta' }}
|
continue-on-error: ${{ matrix.toolchain == 'beta' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: dtolnay/rust-toolchain@master
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.toolchain }}
|
toolchain: ${{ matrix.toolchain }}
|
||||||
components: clippy
|
components: clippy
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
|
||||||
- run: cargo xtask clippy
|
- run: cargo xtask clippy
|
||||||
|
|
||||||
# Run markdownlint on all markdown files in the repository.
|
# Run markdownlint on all markdown files in the repository.
|
||||||
@ -90,8 +110,10 @@ jobs:
|
|||||||
name: Check Markdown
|
name: Check Markdown
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: DavidAnson/markdownlint-cli2-action@v20
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e # v20
|
||||||
with:
|
with:
|
||||||
globs: |
|
globs: |
|
||||||
'**/*.md'
|
'**/*.md'
|
||||||
@ -103,14 +125,19 @@ jobs:
|
|||||||
name: Coverage Report
|
name: Coverage Report
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
components: llvm-tools
|
components: llvm-tools
|
||||||
- uses: taiki-e/install-action@cargo-llvm-cov
|
- uses: taiki-e/install-action@491d37bbaa844af8400b3595395e1bca723e6141 # v2
|
||||||
- uses: Swatinem/rust-cache@v2
|
with:
|
||||||
|
tool: cargo-llvm-cov
|
||||||
|
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
|
||||||
- run: cargo xtask coverage
|
- run: cargo xtask coverage
|
||||||
- uses: codecov/codecov-action@v5
|
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
@ -125,22 +152,27 @@ jobs:
|
|||||||
toolchain: ["1.85.0", "stable"]
|
toolchain: ["1.85.0", "stable"]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: dtolnay/rust-toolchain@master
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.toolchain }}
|
toolchain: ${{ matrix.toolchain }}
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
|
||||||
- run: cargo xtask check --all-features
|
- run: cargo xtask check --all-features
|
||||||
|
|
||||||
build-no-std:
|
build-no-std:
|
||||||
name: Build No-Std
|
name: Build No-Std
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
targets: x86_64-unknown-none
|
targets: x86_64-unknown-none
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
|
||||||
# This makes it easier to debug the exact versions of the dependencies
|
# This makes it easier to debug the exact versions of the dependencies
|
||||||
- run: cargo tree --target x86_64-unknown-none -p ratatui-core
|
- run: cargo tree --target x86_64-unknown-none -p ratatui-core
|
||||||
- run: cargo tree --target x86_64-unknown-none -p ratatui-widgets
|
- run: cargo tree --target x86_64-unknown-none -p ratatui-widgets
|
||||||
@ -156,9 +188,13 @@ jobs:
|
|||||||
name: Check README
|
name: Check README
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: Swatinem/rust-cache@v2
|
with:
|
||||||
- uses: taiki-e/install-action@cargo-rdme
|
persist-credentials: false
|
||||||
|
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
|
||||||
|
- uses: taiki-e/install-action@491d37bbaa844af8400b3595395e1bca723e6141 # v2
|
||||||
|
with:
|
||||||
|
tool: cargo-rdme
|
||||||
- run: cargo xtask readme --check
|
- run: cargo xtask readme --check
|
||||||
|
|
||||||
# Run cargo rustdoc with the same options that would be used by docs.rs, taking into account the
|
# Run cargo rustdoc with the same options that would be used by docs.rs, taking into account the
|
||||||
@ -169,10 +205,16 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
RUSTDOCFLAGS: -Dwarnings
|
RUSTDOCFLAGS: -Dwarnings
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: dtolnay/rust-toolchain@nightly
|
with:
|
||||||
- uses: dtolnay/install@cargo-docs-rs
|
persist-credentials: false
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
|
with:
|
||||||
|
toolchain: nightly
|
||||||
|
- uses: dtolnay/install@74f735cdf643820234e37ae1c4089a08fd266d8a # master
|
||||||
|
with:
|
||||||
|
crate: cargo-docs-rs
|
||||||
|
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
|
||||||
- run: cargo xtask docs
|
- run: cargo xtask docs
|
||||||
|
|
||||||
# Run cargo test on the documentation of the crate. This will catch any code examples that don't
|
# Run cargo test on the documentation of the crate. This will catch any code examples that don't
|
||||||
@ -181,9 +223,13 @@ jobs:
|
|||||||
name: Test Docs
|
name: Test Docs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
with:
|
||||||
- uses: Swatinem/rust-cache@v2
|
persist-credentials: false
|
||||||
|
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
|
||||||
- run: cargo xtask test-docs
|
- run: cargo xtask test-docs
|
||||||
|
|
||||||
# Run cargo test on the libraries of the crate.
|
# Run cargo test on the libraries of the crate.
|
||||||
@ -195,9 +241,13 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
toolchain: ["1.85.0", "stable"]
|
toolchain: ["1.85.0", "stable"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
with:
|
||||||
- uses: Swatinem/rust-cache@v2
|
persist-credentials: false
|
||||||
|
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
|
||||||
- run: cargo xtask test-libs
|
- run: cargo xtask test-libs
|
||||||
|
|
||||||
# Run cargo test on all the backends.
|
# Run cargo test on all the backends.
|
||||||
@ -214,7 +264,11 @@ jobs:
|
|||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
backend: termion
|
backend: termion
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
with:
|
||||||
- uses: Swatinem/rust-cache@v2
|
persist-credentials: false
|
||||||
|
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
|
||||||
- run: cargo xtask test-backend ${{ matrix.backend }}
|
- run: cargo xtask test-backend ${{ matrix.backend }}
|
||||||
|
16
.github/workflows/release-alpha.yml
vendored
16
.github/workflows/release-alpha.yml
vendored
@ -1,5 +1,9 @@
|
|||||||
name: Release alpha version
|
name: Release alpha version
|
||||||
|
|
||||||
|
# Set the permissions of the github token to the minimum and only enable what is needed
|
||||||
|
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
@ -20,21 +24,25 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
# probably needs to be set to true for git-cliff to work - check build
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Calculate the next release
|
- name: Calculate the next release
|
||||||
run: .github/workflows/calculate-alpha-release.bash
|
run: .github/workflows/calculate-alpha-release.bash
|
||||||
|
|
||||||
- name: Install Rust stable
|
- name: Install Rust stable
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
run: cargo publish --allow-dirty --token ${{ secrets.CARGO_TOKEN }}
|
run: cargo publish --allow-dirty --token ${{ secrets.CARGO_TOKEN }}
|
||||||
|
|
||||||
- name: Generate a changelog
|
- name: Generate a changelog
|
||||||
uses: orhun/git-cliff-action@v4
|
uses: orhun/git-cliff-action@4a4a951bc43fafe41cd2348d181853f52356bee7 # v4
|
||||||
with:
|
with:
|
||||||
config: cliff.toml
|
config: cliff.toml
|
||||||
args: --unreleased --tag ${{ env.NEXT_TAG }} --strip header
|
args: --unreleased --tag ${{ env.NEXT_TAG }} --strip header
|
||||||
@ -42,7 +50,7 @@ jobs:
|
|||||||
OUTPUT: BODY.md
|
OUTPUT: BODY.md
|
||||||
|
|
||||||
- name: Publish on GitHub
|
- name: Publish on GitHub
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1
|
||||||
with:
|
with:
|
||||||
tag: ${{ env.NEXT_TAG }}
|
tag: ${{ env.NEXT_TAG }}
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
29
.github/workflows/release-plz.yml
vendored
29
.github/workflows/release-plz.yml
vendored
@ -1,8 +1,8 @@
|
|||||||
name: Release-plz
|
name: Release-plz
|
||||||
|
|
||||||
permissions:
|
# Set the permissions of the github token to the minimum and only enable what is needed
|
||||||
pull-requests: write
|
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions
|
||||||
contents: write
|
permissions: {}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -14,17 +14,23 @@ jobs:
|
|||||||
# Release unpublished packages.
|
# Release unpublished packages.
|
||||||
release-plz-release:
|
release-plz-release:
|
||||||
name: Release-plz release
|
name: Release-plz release
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.repository_owner == 'ratatui' }}
|
if: ${{ github.repository_owner == 'ratatui' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
- name: Run release-plz
|
- name: Run release-plz
|
||||||
uses: release-plz/action@v0.5
|
uses: release-plz/action@8724d33cd97b8295051102e2e19ca592962238f5 # v0.5
|
||||||
with:
|
with:
|
||||||
command: release
|
command: release
|
||||||
env:
|
env:
|
||||||
@ -34,6 +40,8 @@ jobs:
|
|||||||
# Create a PR with the new versions and changelog, preparing the next release.
|
# Create a PR with the new versions and changelog, preparing the next release.
|
||||||
release-plz-pr:
|
release-plz-pr:
|
||||||
name: Release-plz PR
|
name: Release-plz PR
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.repository_owner == 'ratatui' }}
|
if: ${{ github.repository_owner == 'ratatui' }}
|
||||||
concurrency:
|
concurrency:
|
||||||
@ -41,13 +49,16 @@ jobs:
|
|||||||
cancel-in-progress: false
|
cancel-in-progress: false
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
- name: Run release-plz
|
- name: Run release-plz
|
||||||
uses: release-plz/action@v0.5
|
uses: release-plz/action@8724d33cd97b8295051102e2e19ca592962238f5 # v0.5
|
||||||
with:
|
with:
|
||||||
command: release-pr
|
command: release-pr
|
||||||
env:
|
env:
|
||||||
|
20
.github/workflows/release-stable.yml
vendored
20
.github/workflows/release-stable.yml
vendored
@ -1,5 +1,9 @@
|
|||||||
name: Release stable version
|
name: Release stable version
|
||||||
|
|
||||||
|
# Set the permissions of the github token to the minimum and only enable what is needed
|
||||||
|
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
@ -13,12 +17,14 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
# this possibly needs to be set to true for git-cliff to work - check build results
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Generate a changelog
|
- name: Generate a changelog
|
||||||
uses: orhun/git-cliff-action@v4
|
uses: orhun/git-cliff-action@4a4a951bc43fafe41cd2348d181853f52356bee7 # v4
|
||||||
with:
|
with:
|
||||||
config: cliff.toml
|
config: cliff.toml
|
||||||
args: --latest --strip header
|
args: --latest --strip header
|
||||||
@ -26,7 +32,7 @@ jobs:
|
|||||||
OUTPUT: BODY.md
|
OUTPUT: BODY.md
|
||||||
|
|
||||||
- name: Publish on GitHub
|
- name: Publish on GitHub
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1
|
||||||
with:
|
with:
|
||||||
prerelease: false
|
prerelease: false
|
||||||
bodyFile: BODY.md
|
bodyFile: BODY.md
|
||||||
@ -36,10 +42,14 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Install Rust stable
|
- name: Install Rust stable
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
run: cargo publish --token ${{ secrets.CARGO_TOKEN }}
|
run: cargo publish --token ${{ secrets.CARGO_TOKEN }}
|
||||||
|
26
.github/workflows/zizmor.yml
vendored
Normal file
26
.github/workflows/zizmor.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
name: GitHub Actions Security Analysis with zizmor 🌈
|
||||||
|
|
||||||
|
# docs https://docs.zizmor.sh/integrations/#github-actions
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
pull_request:
|
||||||
|
branches: ["**"]
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
zizmor:
|
||||||
|
name: Run zizmor 🌈
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Run zizmor 🌈
|
||||||
|
uses: zizmorcore/zizmor-action@f52a838cfabf134edcbaa7c8b3677dde20045018 # v0.1.1
|
18
bacon.toml
18
bacon.toml
@ -60,6 +60,22 @@ command = ["cargo", "xtask", "hack"]
|
|||||||
[jobs.format]
|
[jobs.format]
|
||||||
command = ["cargo", "xtask", "format"]
|
command = ["cargo", "xtask", "format"]
|
||||||
|
|
||||||
|
[jobs.zizmor-offline]
|
||||||
|
# zizmor checks the workflow files for security issues. The offline version is generally faster, but
|
||||||
|
# checks for fewer issues.
|
||||||
|
command = ["zizmor", "--color", "always", ".github/workflows", "--offline"]
|
||||||
|
need_stdout = true
|
||||||
|
default_watch = false
|
||||||
|
watch = [".github/workflows/"]
|
||||||
|
|
||||||
|
[jobs.zizmor-online]
|
||||||
|
# zizmor checks the workflow files for security issues. The online version is a bit slower, but it
|
||||||
|
# checks for more issues
|
||||||
|
command = ["zizmor", "--color", "always", ".github/workflows"]
|
||||||
|
need_stdout = true
|
||||||
|
default_watch = false
|
||||||
|
watch = [".github/workflows/"]
|
||||||
|
|
||||||
# You may define here keybindings that would be specific to
|
# You may define here keybindings that would be specific to
|
||||||
# a project, for example a shortcut to launch a specific job.
|
# a project, for example a shortcut to launch a specific job.
|
||||||
# Shortcuts to internal functions (scrolling, toggling, etc.)
|
# Shortcuts to internal functions (scrolling, toggling, etc.)
|
||||||
@ -74,3 +90,5 @@ ctrl-v = "job:coverage-unit-tests-only"
|
|||||||
u = "job:test-unit"
|
u = "job:test-unit"
|
||||||
n = "job:nextest"
|
n = "job:nextest"
|
||||||
f = "job:format"
|
f = "job:format"
|
||||||
|
z = "job:zizmor-offline"
|
||||||
|
shift-z = "job:zizmor-online"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user