mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-21 20:38:44 +00:00
CICD: Build step naming
This commit is contained in:
parent
f5d834407e
commit
bc35592fd9
53
.github/workflows/CICD.yml
vendored
53
.github/workflows/CICD.yml
vendored
@ -27,13 +27,13 @@ jobs:
|
|||||||
# clippy::match_bool is allowed by default from Rust 1.45.0, see
|
# clippy::match_bool is allowed by default from Rust 1.45.0, see
|
||||||
# https://github.com/rust-lang/rust-clippy/commit/e1d13c34b0beaea9a5fbf13687672ef85e779d9f
|
# https://github.com/rust-lang/rust-clippy/commit/e1d13c34b0beaea9a5fbf13687672ef85e779d9f
|
||||||
args: --all-targets --all-features -- --allow clippy::match_bool
|
args: --all-targets --all-features -- --allow clippy::match_bool
|
||||||
- name: Test
|
- name: Run tests
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
|
|
||||||
test_with_new_syntaxes_and_themes:
|
test_with_new_syntaxes_and_themes:
|
||||||
name: Test with new syntaxes and themes
|
name: Run tests with updated syntaxes and themes
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- name: Git checkout
|
- name: Git checkout
|
||||||
@ -94,8 +94,9 @@ jobs:
|
|||||||
- { os: windows-2019 , target: x86_64-pc-windows-gnu }
|
- { os: windows-2019 , target: x86_64-pc-windows-gnu }
|
||||||
- { os: windows-2019 , target: x86_64-pc-windows-msvc }
|
- { os: windows-2019 , target: x86_64-pc-windows-msvc }
|
||||||
steps:
|
steps:
|
||||||
- name: Git checkout
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install prerequisites
|
- name: Install prerequisites
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@ -103,6 +104,7 @@ jobs:
|
|||||||
arm-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
|
arm-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
|
||||||
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
|
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
- name: Extract crate information
|
- name: Extract crate information
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@ -110,6 +112,7 @@ jobs:
|
|||||||
echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
|
echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
|
||||||
echo "PROJECT_MAINTAINER=$(sed -n 's/^authors = \["\(.*\)"\]/\1/p' Cargo.toml)" >> $GITHUB_ENV
|
echo "PROJECT_MAINTAINER=$(sed -n 's/^authors = \["\(.*\)"\]/\1/p' Cargo.toml)" >> $GITHUB_ENV
|
||||||
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: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
@ -117,7 +120,8 @@ jobs:
|
|||||||
target: ${{ matrix.job.target }}
|
target: ${{ matrix.job.target }}
|
||||||
override: true
|
override: true
|
||||||
profile: minimal # minimal component installation (ie, no documentation)
|
profile: minimal # minimal component installation (ie, no documentation)
|
||||||
- name: Info
|
|
||||||
|
- name: Show version information (Rust, cargo, GCC)
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
gcc --version || true
|
gcc --version || true
|
||||||
@ -126,13 +130,15 @@ jobs:
|
|||||||
rustup default
|
rustup default
|
||||||
cargo -V
|
cargo -V
|
||||||
rustc -V
|
rustc -V
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
use-cross: ${{ matrix.job.use-cross }}
|
||||||
command: build
|
command: build
|
||||||
args: --release --target=${{ matrix.job.target }}
|
args: --release --target=${{ matrix.job.target }}
|
||||||
- name: Strip release bin
|
|
||||||
|
- name: Strip debug information from executable
|
||||||
id: strip
|
id: strip
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@ -167,7 +173,8 @@ jobs:
|
|||||||
# Let subsequent steps know where to find the (stripped) bin
|
# Let subsequent steps know where to find the (stripped) bin
|
||||||
echo ::set-output name=BIN_PATH::${BIN_PATH}
|
echo ::set-output name=BIN_PATH::${BIN_PATH}
|
||||||
echo ::set-output name=BIN_NAME::${BIN_NAME}
|
echo ::set-output name=BIN_NAME::${BIN_NAME}
|
||||||
- name: Calculate test options
|
|
||||||
|
- name: Set testing options
|
||||||
id: test-options
|
id: test-options
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@ -175,49 +182,57 @@ jobs:
|
|||||||
unset CARGO_TEST_OPTIONS
|
unset CARGO_TEST_OPTIONS
|
||||||
unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--lib --bin ${PROJECT_NAME}" ;; esac;
|
unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--lib --bin ${PROJECT_NAME}" ;; esac;
|
||||||
echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
|
echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
|
||||||
- name: Test
|
|
||||||
|
- name: Run tests
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
use-cross: ${{ matrix.job.use-cross }}
|
||||||
command: test
|
command: test
|
||||||
args: --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
|
args: --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
|
||||||
- name: bat test run
|
|
||||||
|
- name: Run bat
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
use-cross: ${{ matrix.job.use-cross }}
|
||||||
command: run
|
command: run
|
||||||
args: --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs
|
args: --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs
|
||||||
- name: bat diagnostics output
|
|
||||||
|
- name: Show diagnostics (bat --diagnostic)
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
use-cross: ${{ matrix.job.use-cross }}
|
||||||
command: run
|
command: run
|
||||||
args: --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs --diagnostic
|
args: --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs --diagnostic
|
||||||
- name: Check features regex-onig
|
|
||||||
|
- name: "Feature check: regex-onig"
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
use-cross: ${{ matrix.job.use-cross }}
|
||||||
command: check
|
command: check
|
||||||
args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig
|
args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig
|
||||||
- name: Check features regex-onig,git
|
|
||||||
|
- name: "Feature check: regex-onig,git"
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
use-cross: ${{ matrix.job.use-cross }}
|
||||||
command: check
|
command: check
|
||||||
args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git
|
args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git
|
||||||
- name: Check features regex-onig,paging
|
|
||||||
|
- name: "Feature check: regex-onig,paging"
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
use-cross: ${{ matrix.job.use-cross }}
|
||||||
command: check
|
command: check
|
||||||
args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,paging
|
args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,paging
|
||||||
- name: Check features regex-onig,git,paging
|
|
||||||
|
- name: "Feature check: regex-onig,git,paging"
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
use-cross: ${{ matrix.job.use-cross }}
|
use-cross: ${{ matrix.job.use-cross }}
|
||||||
command: check
|
command: check
|
||||||
args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging
|
args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging
|
||||||
- name: Package
|
|
||||||
|
- name: Create tarball
|
||||||
id: package
|
id: package
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@ -254,7 +269,8 @@ jobs:
|
|||||||
|
|
||||||
# Let subsequent steps know where to find the compressed package
|
# Let subsequent steps know where to find the compressed package
|
||||||
echo ::set-output name=PKG_PATH::"${PKG_STAGING}/${PKG_NAME}"
|
echo ::set-output name=PKG_PATH::"${PKG_STAGING}/${PKG_NAME}"
|
||||||
- name: Debian package
|
|
||||||
|
- name: Create Debian package
|
||||||
id: debian-package
|
id: debian-package
|
||||||
shell: bash
|
shell: bash
|
||||||
if: startsWith(matrix.job.os, 'ubuntu')
|
if: startsWith(matrix.job.os, 'ubuntu')
|
||||||
@ -362,23 +378,26 @@ jobs:
|
|||||||
# build dpkg
|
# build dpkg
|
||||||
fakeroot dpkg-deb --build "${DPKG_DIR}" "${DPKG_PATH}"
|
fakeroot dpkg-deb --build "${DPKG_DIR}" "${DPKG_PATH}"
|
||||||
|
|
||||||
- name: Upload package artifact
|
- name: "Artifact upload: tarball"
|
||||||
uses: actions/upload-artifact@master
|
uses: actions/upload-artifact@master
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.package.outputs.PKG_NAME }}
|
name: ${{ steps.package.outputs.PKG_NAME }}
|
||||||
path: ${{ steps.package.outputs.PKG_PATH }}
|
path: ${{ steps.package.outputs.PKG_PATH }}
|
||||||
- name: Upload Debian package artifact
|
|
||||||
|
- name: "Artifact upload: Debian package"
|
||||||
uses: actions/upload-artifact@master
|
uses: actions/upload-artifact@master
|
||||||
if: steps.debian-package.outputs.DPKG_NAME
|
if: steps.debian-package.outputs.DPKG_NAME
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.debian-package.outputs.DPKG_NAME }}
|
name: ${{ steps.debian-package.outputs.DPKG_NAME }}
|
||||||
path: ${{ steps.debian-package.outputs.DPKG_PATH }}
|
path: ${{ steps.debian-package.outputs.DPKG_PATH }}
|
||||||
|
|
||||||
- name: Check for release
|
- name: Check for release
|
||||||
id: is-release
|
id: is-release
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
|
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
|
||||||
echo ::set-output name=IS_RELEASE::${IS_RELEASE}
|
echo ::set-output name=IS_RELEASE::${IS_RELEASE}
|
||||||
|
|
||||||
- name: Publish archives and packages
|
- name: Publish archives and packages
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: steps.is-release.outputs.IS_RELEASE
|
if: steps.is-release.outputs.IS_RELEASE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user