mirror of
https://github.com/starship/starship.git
synced 2026-06-20 02:02:07 +07:00
ci: Pin actions digests, remove unnecessary actions and add minimumReleaseAge (#7390)
ci: Pin actions digests and add minimumReleaseAge
This commit is contained in:
@@ -24,12 +24,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup | Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup | Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt
|
||||
run: rustup toolchain install stable --profile minimal --component rustfmt --no-self-update
|
||||
|
||||
- name: Build | Format
|
||||
run: cargo fmt --all -- --check
|
||||
@@ -43,18 +41,16 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Setup | Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup | Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
run: rustup toolchain install stable --profile minimal --component clippy --no-self-update
|
||||
|
||||
- name: Setup | Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
|
||||
|
||||
- name: Build | Lint
|
||||
uses: giraffate/clippy-action@94e9bd8deab2618756ec5380f12eb35bcb0a88ca
|
||||
run: cargo clippy --workspace --locked -- -D warnings
|
||||
|
||||
# Ensure that the project could be successfully compiled
|
||||
cargo_check:
|
||||
@@ -62,13 +58,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup | Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup | Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
run: rustup toolchain install stable --profile minimal --no-self-update
|
||||
|
||||
- name: Setup | Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
|
||||
|
||||
- name: Build | Check
|
||||
run: cargo check --workspace --locked
|
||||
@@ -80,13 +76,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup | Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup | Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
run: rustup toolchain install stable --profile minimal --no-self-update
|
||||
|
||||
- name: Setup | Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
|
||||
|
||||
- name: Build | Check
|
||||
run: cargo check --workspace --locked --no-default-features
|
||||
@@ -98,13 +94,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup | Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup | Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
run: rustup toolchain install stable --profile minimal --no-self-update
|
||||
|
||||
- name: Setup | Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
|
||||
|
||||
- name: Build | Check
|
||||
run: cargo check --workspace --locked --all-features
|
||||
@@ -115,28 +111,26 @@ jobs:
|
||||
needs: cargo_check
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
checks: write
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Setup | Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Setup | Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
run: rustup toolchain install stable --profile minimal --no-self-update
|
||||
|
||||
- name: Setup | Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
|
||||
|
||||
- name: Run | Generate Schema
|
||||
run: cargo run --locked --features config-schema -- config-schema > .github/config-schema.json
|
||||
|
||||
- name: Check | Detect Changes
|
||||
uses: reviewdog/action-suggester@v1.24.0
|
||||
with:
|
||||
tool_name: starship config-schema
|
||||
filter_mode: nofilter
|
||||
fail_on_error: 'true'
|
||||
run: |
|
||||
if ! git diff --exit-code .github/config-schema.json; then
|
||||
echo "::error file=.github/config-schema.json::config-schema.json is out of date. Run 'cargo run --features config-schema -- config-schema > .github/config-schema.json' and commit the result."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run tests on Linux, macOS, and Windows
|
||||
# On both Rust stable and Rust nightly
|
||||
@@ -156,20 +150,21 @@ jobs:
|
||||
RUSTFLAGS: ${{ matrix.rustflags || '' }}
|
||||
steps:
|
||||
- name: Setup | Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
# Install all the required dependencies for testing
|
||||
- name: Setup | Rust
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
components: llvm-tools-preview
|
||||
run: |
|
||||
rustup toolchain install ${{ matrix.rust }} --profile minimal --component llvm-tools-preview --no-self-update
|
||||
rustup default ${{ matrix.rust }}
|
||||
|
||||
- name: Setup | Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
|
||||
|
||||
- name: Install cargo-llvm-cov
|
||||
uses: taiki-e/install-action@cargo-llvm-cov
|
||||
uses: taiki-e/install-action@7a4939c09608b2a1986b484eca1d16fd0db8ebef # v2.75.5
|
||||
with:
|
||||
tool: cargo-llvm-cov@0.8.5
|
||||
|
||||
# For windows installer test
|
||||
# On stable rust & main repo pushes only
|
||||
@@ -228,7 +223,7 @@ jobs:
|
||||
STARSHIP_VERSION: v1.2.3
|
||||
|
||||
- name: Sign | Upload Executable [Windows]
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
continue-on-error: true
|
||||
id: unsigned-artifacts
|
||||
if: matrix.os == 'windows-latest' && matrix.rust == 'stable' && github.event_name == 'push' && github.repository == 'starship/starship'
|
||||
@@ -239,7 +234,7 @@ jobs:
|
||||
target/debug/starship-x86_64-pc-windows-msvc.msi
|
||||
|
||||
- name: Sign | Sign [Windows]
|
||||
uses: signpath/github-action-submit-signing-request@v2
|
||||
uses: signpath/github-action-submit-signing-request@bc66d86b015a46e9c6d9700de73143a82f9570ff # v2.1
|
||||
continue-on-error: true
|
||||
if: matrix.os == 'windows-latest' && matrix.rust == 'stable' && github.event_name == 'push' && github.repository == 'starship/starship'
|
||||
with:
|
||||
@@ -252,7 +247,7 @@ jobs:
|
||||
output-artifact-directory: target/debug
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v6
|
||||
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
|
||||
if: github.repository == 'starship/starship'
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user