refactor: increase verbosity of `cargo build` across pipelines
Diff
.cirrus.yml | 9 +++------
.github/workflows/devel.yml | 36 +++++++++++++++++++++++++++---------
.github/workflows/release.yml | 4 +---
3 files changed, 31 insertions(+), 18 deletions(-)
@@ -9,8 +9,6 @@ task:
only_if: $CIRRUS_TAG == ''
env:
RUSTFLAGS: -Dwarnings
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
matrix:
- name: freebsd-amd64-test
env:
@@ -37,14 +35,13 @@ task:
build_test_script:
- . $HOME/.cargo/env
- |
cargo build --verbose --target="$BINARY_ARCH-unknown-freebsd"
cargo rustc --bin static-web-server --verbose --target="$BINARY_ARCH-unknown-freebsd"
target/$BINARY_ARCH-unknown-freebsd/debug/static-web-server -h
task:
only_if: $CIRRUS_TAG != ''
env:
RUSTFLAGS: -Dwarnings
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
GITHUB_TOKEN: ENCRYPTED[d1766ef328d83729917d2ffb875d64c35d1c0177edf8f32e66ec464daf5c1b7b145d65fc6c044a73fffe2235d3b38349]
matrix:
- name: freebsd-amd64-release
@@ -67,7 +64,7 @@ task:
- rustup show
build_script: |
. $HOME/.cargo/env
cargo build --verbose --release --target="$BINARY_ARCH-unknown-freebsd"
cargo rustc --bin static-web-server --verbose --release --target="$BINARY_ARCH-unknown-freebsd"
archive_script: |
staging="static-web-server-$CIRRUS_TAG-$BINARY_ARCH-unknown-freebsd"
mkdir -p "$staging/"
@@ -7,6 +7,8 @@ on:
- staging
- trying
paths:
- .github/workflows/devel.yml
- .cargo/config.toml
- Cargo.lock
- Cargo.toml
- src/**
@@ -19,8 +21,6 @@ jobs:
name: test
runs-on: ${{ matrix.os }}
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_BIN: cargo
TARGET_FLAGS: ""
@@ -154,6 +154,7 @@ jobs:
- name: Set up Cross
if: ${{ !contains(matrix.os, 'windows') && matrix.target != '' }}
shell: bash
run: |
if [[ "${{ matrix.build }}" == "linux-android-armv7" ]] || [[ "${{ matrix.build }}" == "linux-android-arm64" ]]; then
@@ -163,16 +164,19 @@ jobs:
echo "CARGO_BIN=cross" >> $GITHUB_ENV
fi
echo "TARGET_FLAGS=--target=${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
- name: Show command used for Cargo
- name: Setup Cargo
shell: bash
run: |
if [[ "${{ matrix.target }}" != "" ]]; then
echo "TARGET_FLAGS=--target=${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
fi
echo "cargo command is: ${{ env.CARGO_BIN }}"
echo "target flag is: ${{ env.TARGET_FLAGS }}"
echo "target dir is: ${{ env.TARGET_DIR }}"
- name: Skip tests
shell: bash
if: ${{ contains(fromJSON('["macos-arm64", "linux-android-arm64", "linux-android-armv7"]'), matrix.build) }}
run: |
@@ -181,14 +185,28 @@ jobs:
- name: Run tests
shell: bash
run: |
if [[ "${{ matrix.build }}" == "pinned" ]]; then unset CARGO_REGISTRIES_CRATES_IO_PROTOCOL; fi
${{ env.CARGO_BIN }} test --verbose ${{ env.TARGET_FLAGS }} ${{ env.SKIP_TESTS }}
- name: Run build
shell: bash
run: |
if [[ "${{ matrix.build }}" == "pinned" ]]; then unset CARGO_REGISTRIES_CRATES_IO_PROTOCOL; fi
${{ env.CARGO_BIN }} build --verbose ${{ env.TARGET_FLAGS }}
${{ env.CARGO_BIN }} rustc --bin static-web-server --verbose ${{ env.TARGET_FLAGS }}
- name: Run executable
shell: bash
run: |
case "${{ matrix.build }}" in
*-arm*)
echo "arm(64) is not supported on ci, can not execute!"
;;
*)
if [[ "${{ matrix.os }}" == "windows-2022" ]]; then
target/${{ matrix.target }}/debug/static-web-server.exe -h
else
target/${{ matrix.target }}/debug/static-web-server -h
fi
;;
esac
checks:
name: checks
@@ -37,8 +37,6 @@ jobs:
needs: ['create-release']
runs-on: ${{ matrix.os }}
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_BIN: cargo
@@ -176,7 +174,7 @@ jobs:
echo "target dir is: ${{ env.TARGET_DIR }}"
- name: Build release binary
run: ${{ env.CARGO_BIN }} build --verbose --release ${{ env.TARGET_FLAGS }}
run: ${{ env.CARGO_BIN }} rustc --bin static-web-server --verbose --release ${{ env.TARGET_FLAGS }}
- name: Build archive
shell: bash