mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-21 12:28:30 +00:00
Replace unmaintained GitHub Actions
The unmaintained `actions-rs/*` actions are replaced with `dtolnay/rust-toolchain`, `taiki-e/install-action` and plain cargo commands.
This commit is contained in:
parent
5e77ca37e8
commit
f0fe88a732
155
.github/workflows/CICD.yml
vendored
155
.github/workflows/CICD.yml
vendored
@ -18,11 +18,8 @@ jobs:
|
|||||||
name: Ensure 'cargo fmt' has been run
|
name: Ensure 'cargo fmt' has been run
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
|
||||||
default: true
|
|
||||||
profile: minimal
|
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- run: cargo fmt -- --check
|
- run: cargo fmt -- --check
|
||||||
@ -46,22 +43,14 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install rust toolchain (v${{ env.MIN_SUPPORTED_RUST_VERSION }})
|
- name: Install rust toolchain (v${{ env.MIN_SUPPORTED_RUST_VERSION }})
|
||||||
uses: actions-rs/toolchain@v1
|
uses: dtolnay/rust-toolchain@master
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }}
|
toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }}
|
||||||
default: true
|
|
||||||
profile: minimal # minimal component installation (ie, no documentation)
|
|
||||||
components: clippy
|
components: clippy
|
||||||
- name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
|
- name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo clippy --locked --all-targets ${{ env.MSRV_FEATURES }}
|
||||||
with:
|
|
||||||
command: clippy
|
|
||||||
args: --locked --all-targets ${{ env.MSRV_FEATURES }}
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo test --locked ${{ env.MSRV_FEATURES }}
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --locked ${{ env.MSRV_FEATURES }}
|
|
||||||
|
|
||||||
test_with_new_syntaxes_and_themes:
|
test_with_new_syntaxes_and_themes:
|
||||||
name: Run tests with updated syntaxes and themes
|
name: Run tests with updated syntaxes and themes
|
||||||
@ -72,33 +61,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true # we need all syntax and theme submodules
|
submodules: true # we need all syntax and theme submodules
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
default: true
|
|
||||||
profile: minimal
|
|
||||||
- name: Build and install bat
|
- name: Build and install bat
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo install --locked --path .
|
||||||
with:
|
|
||||||
command: install
|
|
||||||
args: --locked --path .
|
|
||||||
- name: Rebuild binary assets (syntaxes and themes)
|
- name: Rebuild binary assets (syntaxes and themes)
|
||||||
run: bash assets/create.sh
|
run: bash assets/create.sh
|
||||||
- name: Build and install bat with updated assets
|
- name: Build and install bat with updated assets
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo install --locked --path .
|
||||||
with:
|
|
||||||
command: install
|
|
||||||
args: --locked --path .
|
|
||||||
- name: Run unit tests with new syntaxes and themes
|
- name: Run unit tests with new syntaxes and themes
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo test --locked --release
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --locked --release
|
|
||||||
- name: Run ignored-by-default unit tests with new syntaxes and themes
|
- name: Run ignored-by-default unit tests with new syntaxes and themes
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo test --locked --release --test assets -- --ignored
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --locked --release --test assets -- --ignored
|
|
||||||
- name: Syntax highlighting regression test
|
- name: Syntax highlighting regression test
|
||||||
run: tests/syntax-tests/regression_test.sh
|
run: tests/syntax-tests/regression_test.sh
|
||||||
- name: List of languages
|
- name: List of languages
|
||||||
@ -118,21 +91,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "BAT_SYSTEM_CONFIG_PREFIX=$GITHUB_WORKSPACE/tests/examples/system_config" >> $GITHUB_ENV
|
echo "BAT_SYSTEM_CONFIG_PREFIX=$GITHUB_WORKSPACE/tests/examples/system_config" >> $GITHUB_ENV
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
default: true
|
|
||||||
profile: minimal
|
|
||||||
- name: Build and install bat
|
- name: Build and install bat
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo install --locked --path .
|
||||||
with:
|
|
||||||
command: install
|
|
||||||
args: --locked --path .
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo test --locked --test system_wide_config -- --ignored
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --locked --test system_wide_config -- --ignored
|
|
||||||
|
|
||||||
documentation:
|
documentation:
|
||||||
name: Documentation
|
name: Documentation
|
||||||
@ -141,18 +104,11 @@ jobs:
|
|||||||
- name: Git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
default: true
|
|
||||||
profile: minimal
|
|
||||||
- name: Check documentation
|
- name: Check documentation
|
||||||
env:
|
env:
|
||||||
RUSTDOCFLAGS: -D warnings
|
RUSTDOCFLAGS: -D warnings
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo doc --locked --no-deps --document-private-items --all-features
|
||||||
with:
|
|
||||||
command: doc
|
|
||||||
args: --locked --no-deps --document-private-items --all-features
|
|
||||||
- name: Show man page
|
- name: Show man page
|
||||||
run: man $(find . -name bat.1)
|
run: man $(find . -name bat.1)
|
||||||
|
|
||||||
@ -174,6 +130,8 @@ jobs:
|
|||||||
- { target: x86_64-pc-windows-msvc , os: windows-2019 }
|
- { target: x86_64-pc-windows-msvc , os: windows-2019 }
|
||||||
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
|
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
|
||||||
- { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
|
- { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
|
||||||
|
env:
|
||||||
|
BUILD_CMD: cargo
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -195,12 +153,20 @@ jobs:
|
|||||||
echo "PROJECT_HOMEPAGE=$(sed -n 's/^homepage = "\(.*\)"/\1/p' Cargo.toml)" >> $GITHUB_ENV
|
echo "PROJECT_HOMEPAGE=$(sed -n 's/^homepage = "\(.*\)"/\1/p' Cargo.toml)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
targets: ${{ matrix.job.target }}
|
||||||
target: ${{ matrix.job.target }}
|
|
||||||
override: true
|
- name: Install cross
|
||||||
profile: minimal # minimal component installation (ie, no documentation)
|
if: matrix.job.use-cross
|
||||||
|
uses: taiki-e/install-action@v2
|
||||||
|
with:
|
||||||
|
tool: cross
|
||||||
|
|
||||||
|
- name: Overwrite build command env variable
|
||||||
|
if: matrix.job.use-cross
|
||||||
|
shell: bash
|
||||||
|
run: echo "BUILD_CMD=cross" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Show version information (Rust, cargo, GCC)
|
- name: Show version information (Rust, cargo, GCC)
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -213,11 +179,8 @@ jobs:
|
|||||||
rustc -V
|
rustc -V
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: actions-rs/cargo@v1
|
shell: bash
|
||||||
with:
|
run: $BUILD_CMD build --locked --release --target=${{ matrix.job.target }}
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
|
||||||
command: build
|
|
||||||
args: --locked --release --target=${{ matrix.job.target }}
|
|
||||||
|
|
||||||
- name: Strip debug information from executable
|
- name: Strip debug information from executable
|
||||||
id: strip
|
id: strip
|
||||||
@ -265,60 +228,36 @@ jobs:
|
|||||||
echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
|
echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
uses: actions-rs/cargo@v1
|
shell: bash
|
||||||
with:
|
run: $BUILD_CMD test --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
|
||||||
command: test
|
|
||||||
args: --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
|
|
||||||
|
|
||||||
- name: Run bat
|
- name: Run bat
|
||||||
uses: actions-rs/cargo@v1
|
shell: bash
|
||||||
with:
|
run: $BUILD_CMD run --locked --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
|
||||||
command: run
|
|
||||||
args: --locked --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs
|
|
||||||
|
|
||||||
- name: Show diagnostics (bat --diagnostic)
|
- name: Show diagnostics (bat --diagnostic)
|
||||||
uses: actions-rs/cargo@v1
|
shell: bash
|
||||||
with:
|
run: $BUILD_CMD run --locked --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs --diagnostic
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
|
||||||
command: run
|
|
||||||
args: --locked --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs --diagnostic
|
|
||||||
|
|
||||||
- name: "Feature check: regex-onig"
|
- name: "Feature check: regex-onig"
|
||||||
uses: actions-rs/cargo@v1
|
shell: bash
|
||||||
with:
|
run: $BUILD_CMD check --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
|
||||||
command: check
|
|
||||||
args: --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig
|
|
||||||
|
|
||||||
- name: "Feature check: regex-onig,git"
|
- name: "Feature check: regex-onig,git"
|
||||||
uses: actions-rs/cargo@v1
|
shell: bash
|
||||||
with:
|
run: $BUILD_CMD check --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
|
||||||
command: check
|
|
||||||
args: --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git
|
|
||||||
|
|
||||||
- name: "Feature check: regex-onig,paging"
|
- name: "Feature check: regex-onig,paging"
|
||||||
uses: actions-rs/cargo@v1
|
shell: bash
|
||||||
with:
|
run: $BUILD_CMD check --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,paging
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
|
||||||
command: check
|
|
||||||
args: --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,paging
|
|
||||||
|
|
||||||
- name: "Feature check: regex-onig,git,paging"
|
- name: "Feature check: regex-onig,git,paging"
|
||||||
uses: actions-rs/cargo@v1
|
shell: bash
|
||||||
with:
|
run: $BUILD_CMD check --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
|
||||||
command: check
|
|
||||||
args: --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging
|
|
||||||
|
|
||||||
- name: "Feature check: minimal-application"
|
- name: "Feature check: minimal-application"
|
||||||
uses: actions-rs/cargo@v1
|
shell: bash
|
||||||
with:
|
run: $BUILD_CMD check --locked --target=${{ matrix.job.target }} --verbose --no-default-features --features minimal-application
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
|
||||||
command: check
|
|
||||||
args: --locked --target=${{ matrix.job.target }} --verbose --no-default-features --features minimal-application
|
|
||||||
|
|
||||||
- name: Create tarball
|
- name: Create tarball
|
||||||
id: package
|
id: package
|
||||||
|
Loading…
x
Reference in New Issue
Block a user