Skip to content

Commit 621ab60

Browse files
committed
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.
1 parent 020492f commit 621ab60

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.github/workflows/CICD.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
min_version:
4040
name: Minimum supported rust version
4141
runs-on: ubuntu-20.04
42+
env:
43+
MSRV_FEATURES: --no-default-features --features minimal-application,bugreport,build-assets
4244
steps:
4345
- name: Checkout source code
4446
uses: actions/checkout@v2
@@ -54,12 +56,12 @@ jobs:
5456
uses: actions-rs/cargo@v1
5557
with:
5658
command: clippy
57-
args: --locked --all-targets --all-features
59+
args: --locked --all-targets ${{ env.MSRV_FEATURES }}
5860
- name: Run tests
5961
uses: actions-rs/cargo@v1
6062
with:
6163
command: test
62-
args: --locked
64+
args: --locked ${{ env.MSRV_FEATURES }}
6365

6466
test_with_new_syntaxes_and_themes:
6567
name: Run tests with updated syntaxes and themes

tests/integration_tests.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@ fn header_full_binary() {
987987
}
988988

989989
#[test]
990+
#[cfg(feature = "git")] // Expected output assumes git is enabled
990991
fn header_default() {
991992
bat()
992993
.arg("--paging=never")
@@ -1011,6 +1012,7 @@ fn header_default() {
10111012
}
10121013

10131014
#[test]
1015+
#[cfg(feature = "git")] // Expected output assumes git is enabled
10141016
fn header_default_is_default() {
10151017
bat()
10161018
.arg("--paging=never")
@@ -1373,6 +1375,7 @@ fn plain_mode_does_not_add_nonexisting_newline() {
13731375

13741376
// Regression test for https://github.com/sharkdp/bat/issues/299
13751377
#[test]
1378+
#[cfg(feature = "git")] // Expected output assumes git is enabled
13761379
fn grid_for_file_without_newline() {
13771380
bat()
13781381
.arg("--paging=never")

tests/snapshot_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
#[cfg(feature = "git")]
12
mod tester;
23

3-
use crate::tester::BatTester;
4-
54
macro_rules! snapshot_tests {
65
($($test_name: ident: $style: expr,)*) => {
76
$(
87
#[test]
8+
#[cfg(feature = "git")]
99
fn $test_name() {
10-
let bat_tester = BatTester::default();
10+
let bat_tester = tester::BatTester::default();
1111
bat_tester.test_snapshot(stringify!($test_name), $style);
1212
}
1313
)*

0 commit comments

Comments
 (0)