Commit Graph

163 Commits (3c2ee04b9c57f625be35a9d6b510a66b7b049141)

Author SHA1 Message Date
Constantin Nickel 89c5683f8d Use cargo's `strip` option to remove symbols+debuginfo from the binaries 2 years ago
Constantin Nickel 52f6239d28 Fix `jq` expression for retrieving `rust-version` in MSRV build job 2 years ago
Constantin Nickel 40abebff8e Get the MSRV for the build job from the package metadata
Co-authored-by: Martin Nordholts <enselic@gmail.com>
2 years ago
Constantin Nickel 3c59a4203c Replace deprecated `set-output` GitHub workflow command
The command is deprecated since Oct. 22 and is replaced by writing the
output variables into a file.

```
echo "NAME=${value}" >> $GITHUB_OUTPUT
```
2 years ago
Constantin Nickel f0fe88a732 Replace unmaintained GitHub Actions
The unmaintained `actions-rs/*` actions are replaced with `dtolnay/rust-toolchain`,
`taiki-e/install-action` and plain cargo commands.
2 years ago
Martin Nordholts ec6e9c29ac
Bump MSRV to 1.62 (#2496)
* Bump MSRV to 1.62

Mainly to be able to derive default enum variants.

* CHANGELOG.md: Update
2 years ago
Martin Nordholts 4e34b362f8 Require changes to `-h` and `--help` to be blessed
From now on, any changes to the help texts will be visible in PR diffs,
which will make it very easy to review, and very hard to accidentally
miss changes to help texts.

If a contributor makes a change to help texts, the `cargo test` failure
text they will see contains instructions on how to update the blessed
help texts:

    error: expect test failed
       --> ../doc/long-help.txt

    You can update all `expect!` tests by running:

        env UPDATE_EXPECT=1 cargo test

In short, to update blessed help texts, one simply does

    env UPDATE_EXPECT=1 cargo test

Do not run the tests if the `git` feature is missing, since then
`--diff` will be missing from `--help`. And do not run the tests on
Windows, because then the help text will contain the term `.exe`.

Move man page step to after cargo doc step so that the man page exists
when we look for it.
2 years ago
dependabot[bot] 0cc4e98560 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years ago
Gábor Lipták 9051fc5465 Add github-actions to Dependabot
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2 years ago
Martin Nordholts 2dd2994b2f Merge remote-tracking branch 'origin/master' into feature/668/add-systemwide-config 2 years ago
David Peter 45d6b1af3b Bump MSRV to 1.60
see https://github.com/rust-lang/git2-rs/issues/838
2 years ago
Martin Nordholts 621ab6078f 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.
2 years ago
David Peter 02a9d191ed Bump MSRV to 1.58 2 years ago
Martin Nordholts ab8f97b0bb Bump MSRV to 1.56.1
This is what `hashbrown` did recently: https://github.com/rust-lang/hashbrown/pull/298

And it causes CI failures for us. Examples:
* https://github.com/sharkdp/bat/pull/2266
* https://github.com/sharkdp/bat/pull/2265

The path of least resistance for us is to also bump MSRV, so let's do
that. 1.56.1 was released [9 months
ago](https://blog.rust-lang.org/2021/11/01/Rust-1.56.1.html).
2 years ago
David Peter e9f8370b13
Refer to discussions page in issue templates. 2 years ago
David Peter 6db64cf050 Use cross to build x86_64-unknown-linux-gnu executables
We do this in order to link against older versions of glibc.

closes #2106
2 years ago
Martin Nordholts 719248f1c1
Simplify release-checklist.md by printing `-h`, `--help` and `man` in CI (#2183)
* Simplify release-checklist.md by printing `-h`, `--help` and `man` in CI

Note that we run `find . -name bat.1` before we run anything with
`--all-features`, because `--all-features` is considered a separate
target, and so we will get a different (but identical) `bat.1`. For
example, we might have these:

    ./target/debug/build/bat-218e9538b4996215/out/assets/manual/bat.1
    ./target/debug/build/bat-89d6f56802af023f/out/assets/manual/bat.1

By showing the man page earlier, there is only one `bat.1` to pick from.

* Use plain `man $(find . -name bat.1)`
2 years ago
Martin Nordholts 3239d3be2a bug_report.md template: Explicitly ask for steps 2 years ago
Martin Nordholts 19033d7315 bug_report.md template: Mention some already reported bugs 2 years ago
Patrick Pichler 6b660ef63a Add test for systemwide config file support
There is now a new stage in the CICD workflow present, which will build
`bat` with the `BAT_SYSTEM_CONFIG_PREFIX` set to load the config file
from `/tests/examples/system_config/bat/config`, plus a basic set of
tests, to ensure the feature is working as expected. By default the
tests are set to ignored, as they need special setup before they can be
run.
3 years ago
Mahdi Dibaiee 6dc621ec18 Set minimum supported rust version to 1.51 3 years ago
Martin Nordholts ce89fb2751 CICD: Add check for accidental inclusion of GPL:ed code 3 years ago
Martin Nordholts 043f3381b0
CICD: Make the 'cargo fmt' check a toplevel job (#1883)
Mainly to make it easier to see what went wrong when it fails.

If this ever gets of out sync with a particular Rust version, we can most likely
save the situation by introducing a `rustfmt.toml` file.
3 years ago
Martin Nordholts 418fce5683 Bump MSRV to 1.46
See #1874 and #1872.
3 years ago
Kuan-Yi Li 47283f226a Add bash completion to deb package
From the discussion in #1734, instead of using `env.PROJECT_NAME`,
`steps.strip.outputs.BIN_NAME` could potentially be a better choice as
the filename needs to match the called executable for bash-completion's
on demand loading to work. This `BIN_NAME` needs to stay in sync with
`env.PROJECT_EXECUTABLE` which is replaced in the template, but not
available for the deb build at this stage.

Follow the same route as for the fish/zsh completions for now for the
sake of consistency.

Closes #1733
3 years ago
Martin Nordholts d935ea1cda
Add regression testing for the custom assets functionality (#1829)
The test is following the same steps regular users are instructed to follow:
https://github.com/sharkdp/bat/blob/master/README.md#adding-new-syntaxes--language-definitions
3 years ago
Martin Nordholts 8ca852c728
CICD: Put documentation testing in its own job (#1831)
For increased parallelization and thus a faster CICD pipeline.
3 years ago
Martin Nordholts 355a82db54 CICD: Sort build matrix by target 3 years ago
Martin Nordholts b3e17bde82 CICD: Remove disabled windows-2019 i686-pc-windows-gnu from build matrix
It just messes up alignment. Nothing gets better by keeing it around.
3 years ago
Martin Nordholts 4b38e7b1d7 CICD: Swap target and os in matrix job name
The full name can frequently not be shown, and target is more relevant than os,
so show target first.
3 years ago
Rashil Gandhi 43afae34be
Add PowerShell completion file (#1826) 3 years ago
Martin Nordholts 19c3e82abf
Replace deprecated 'error-chain' with 'thiserror' (#1820)
We can't use #[from] on Error::Msg(String) because String does not implement Error.
(Which it shouldn't; see e.g. https://internals.rust-lang.org/t/impl-error-for-string/8881.)
So we implement From manually for Error::Msg, since our current code was written
in that way for error-chain.
3 years ago
David Peter ff70a80741 Add statically linked binaries for ARM 3 years ago
David Peter ecdb17148d Use Ubuntu 20.04 instead of 18.04 3 years ago
a1346054 51edacb5eb style: trim excess whitespace 3 years ago
Martin Nordholts cbd96237fd CICD: Add 'cargo fmt' check 3 years ago
Martin Nordholts 25fa577cd0 Make 'build-assets' an optional capability for application
Also structure features a bit more clever to avoid duplication of
feature dependency declarations.
3 years ago
Martin Nordholts cb4973987b Cargo.toml: Introduce 'quick-build-application' feature
Use it like this:

  cargo build --no-default-features --features quick-build-application

It reduces dependencies to build from 154 to 125, allowing quicker iteration
when developing the app.
3 years ago
Martin Nordholts 697d106bd4 CICD: Pass --locked to all cargo commands
To avoid that earlier cargo commands "fixes" Cargo.lock before cargo commands
with --locked has a chance to check if it is up to date.
3 years ago
David Peter fb1ab09e3e Add Enselic in FUNDING.yml 3 years ago
David Peter 84e2a2e5d1 Add custom FUNDING.yml 3 years ago
David Peter fddd11a205 CICD: sync with pastel, minor changes 3 years ago
Ville Skyttä e05f5010da Add bash completion
Closes https://github.com/sharkdp/bat/issues/1010
3 years ago
dependabot-preview[bot] 285b1556a9 Upgrade to GitHub-native Dependabot 3 years ago
Marco Ieni 8321cc661c
CI: check docs (#1612) 3 years ago
Martin Nordholts 8f93844427 CICD: Remove explicit allow of clippy::match_bool since MSRV 1.45 bump
Now that we are on MSRV 1.45, there is no need to "backport" the change
that reclassified clippy::match_bool as "pedantic".
4 years ago
David Peter 52f84b063c Update dependencies, MSRV: 1.45 4 years ago
David Peter 2540311cdf Update bug report issue template (--diagnostic option) 4 years ago
Martin Nordholts 9db9a38565 CICD: Add workflow_dispatch to enable manual builds
Which is useful when you want to test a fix without creating a PR for
it.
4 years ago
Martin Nordholts 0371f55541 CICD: Don't run jobs twice in PRs
Without this change, creating a PR triggers all jobs to run twice. Once
due to a push event and once due to a pull_request event.

Change to only trigger jobs due to push when pushing a tag or to the
master branch, to avoid duplicate jobs for each PR.
4 years ago