mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-18 20:11:03 +00:00
CI: Check MSRV without git feature enabled
git2-rs MSRV policy is to only support latest stable rust (see https://github.com/rust-lang/git2-rs#rust-version-requirements), so it does not make sense to run our MSRV tests with git enabled.
This commit is contained in:
parent
020492f7e6
commit
621ab6078f
6
.github/workflows/CICD.yml
vendored
6
.github/workflows/CICD.yml
vendored
@ -39,6 +39,8 @@ jobs:
|
|||||||
min_version:
|
min_version:
|
||||||
name: Minimum supported rust version
|
name: Minimum supported rust version
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
env:
|
||||||
|
MSRV_FEATURES: --no-default-features --features minimal-application,bugreport,build-assets
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@ -54,12 +56,12 @@ jobs:
|
|||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: clippy
|
command: clippy
|
||||||
args: --locked --all-targets --all-features
|
args: --locked --all-targets ${{ env.MSRV_FEATURES }}
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
args: --locked
|
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
|
||||||
|
@ -987,6 +987,7 @@ fn header_full_binary() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")] // Expected output assumes git is enabled
|
||||||
fn header_default() {
|
fn header_default() {
|
||||||
bat()
|
bat()
|
||||||
.arg("--paging=never")
|
.arg("--paging=never")
|
||||||
@ -1011,6 +1012,7 @@ fn header_default() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")] // Expected output assumes git is enabled
|
||||||
fn header_default_is_default() {
|
fn header_default_is_default() {
|
||||||
bat()
|
bat()
|
||||||
.arg("--paging=never")
|
.arg("--paging=never")
|
||||||
@ -1373,6 +1375,7 @@ fn plain_mode_does_not_add_nonexisting_newline() {
|
|||||||
|
|
||||||
// Regression test for https://github.com/sharkdp/bat/issues/299
|
// Regression test for https://github.com/sharkdp/bat/issues/299
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")] // Expected output assumes git is enabled
|
||||||
fn grid_for_file_without_newline() {
|
fn grid_for_file_without_newline() {
|
||||||
bat()
|
bat()
|
||||||
.arg("--paging=never")
|
.arg("--paging=never")
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
|
#[cfg(feature = "git")]
|
||||||
mod tester;
|
mod tester;
|
||||||
|
|
||||||
use crate::tester::BatTester;
|
|
||||||
|
|
||||||
macro_rules! snapshot_tests {
|
macro_rules! snapshot_tests {
|
||||||
($($test_name: ident: $style: expr,)*) => {
|
($($test_name: ident: $style: expr,)*) => {
|
||||||
$(
|
$(
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn $test_name() {
|
fn $test_name() {
|
||||||
let bat_tester = BatTester::default();
|
let bat_tester = tester::BatTester::default();
|
||||||
bat_tester.test_snapshot(stringify!($test_name), $style);
|
bat_tester.test_snapshot(stringify!($test_name), $style);
|
||||||
}
|
}
|
||||||
)*
|
)*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user