mirror of
https://github.com/sharkdp/bat.git
synced 2025-06-20 17:48:00 +02:00
CICD: Build: Add separate 'Calculate test options' step
And move it down to right before it is needed, to reduce its scope. For #1474
This commit is contained in:
parent
b98ec4bbc5
commit
7b6388b19f
19
.github/workflows/CICD.yml
vendored
19
.github/workflows/CICD.yml
vendored
@ -110,15 +110,6 @@ 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: Initialize workflow variables
|
|
||||||
id: vars
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
# target-specific options
|
|
||||||
# # * test only library unit tests and binary for arm-type targets
|
|
||||||
unset CARGO_TEST_OPTIONS
|
|
||||||
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}
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
@ -176,12 +167,20 @@ 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
|
||||||
|
id: test-options
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# test only library unit tests and binary for arm-type targets
|
||||||
|
unset CARGO_TEST_OPTIONS
|
||||||
|
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}
|
||||||
- name: Test
|
- name: Test
|
||||||
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.vars.outputs.CARGO_TEST_OPTIONS}}
|
args: --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
|
||||||
- name: bat test run
|
- name: bat test run
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user