Update CICD.yml
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by rindeal · committed by David Peter · parent 2efc633 · Browse files · 1 file·+16 added−7 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+16 added−7 removed
- other:+16 added−7 removed
Provenance
- Commit
83edd2f- Tree
3cac201- Author
rindeal <dev.rindeal@gmail.com>- Committer
David Peter <sharkdp@users.noreply.github.com>- Parent
2efc633
1 file changed+16 added−7 removed
modified:.github/workflows/CICD.yml+16 added-7 removed
20 unmodified lines21 - uses: actions/checkout@v422 - name: Extract crate information23 id: crate_metadata24 run: |25- cargo metadata --no-deps --format-version 1 | jq -r '"name=" + .packages[0].name' | tee -a $GITHUB_OUTPUT26- cargo metadata --no-deps --format-version 1 | jq -r '"version=" + .packages[0].version' | tee -a $GITHUB_OUTPUT27- cargo metadata --no-deps --format-version 1 | jq -r '"maintainer=" + .packages[0].authors[0]' | tee -a $GITHUB_OUTPUT28- cargo metadata --no-deps --format-version 1 | jq -r '"homepage=" + .packages[0].homepage' | tee -a $GITHUB_OUTPUT29- cargo metadata --no-deps --format-version 1 | jq -r '"msrv=" + .packages[0].rust_version' | tee -a $GITHUB_OUTPUT25+ cargo metadata --no-deps --format-version 1 | jq -r '26+ .packages[0] |27+ [28+ "name=" + .name,29+ "version=" + .version,30+ "maintainer=" + (.authors[0] // ""),31+ "homepage=" + (.homepage // ""),32+ "msrv=" + (.rust_version // ""),33+ "bin-name=" + ( (.targets[] | select(.kind[0] == "bin") | .name) // .name )34+ ] |35+ join("\n")36+ ' | tee -a $GITHUB_OUTPUT37 outputs:38 name: ${{ steps.crate_metadata.outputs.name }}39 version: ${{ steps.crate_metadata.outputs.version }}40 maintainer: ${{ steps.crate_metadata.outputs.maintainer }}41 homepage: ${{ steps.crate_metadata.outputs.homepage }}42 msrv: ${{ steps.crate_metadata.outputs.msrv }}43+ bin-name: ${{ steps.crate_metadata.outputs.bin-name }}44 45 ensure_cargo_fmt:46 name: Ensure 'cargo fmt' has been run47 runs-on: ubuntu-20.0474 unmodified lines122 123 - name: Show version information (Rust, cargo, GCC)124 shell: bash125 run: |126+ set -x127 gcc --version || true128 rustup -V129 rustup toolchain list130 rustup default14 unmodified lines145 *-pc-windows-*) EXE_suffix=".exe" ;;146 esac;147 148 # Setup paths140- BIN_NAME="${{ needs.crate_metadata.outputs.name }}${EXE_suffix}"149+ BIN_NAME="${{ needs.crate_metadata.outputs.bin-name }}${EXE_suffix}"150 BIN_PATH="target/${{ matrix.job.target }}/release/${BIN_NAME}"151 152 # Let subsequent steps know where to find the binary153 echo "BIN_PATH=${BIN_PATH}" >> $GITHUB_OUTPUT4 unmodified lines158 shell: bash159 run: |160 # test only library unit tests and binary for arm-type targets161 unset CARGO_TEST_OPTIONS153- unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--bin ${{ needs.crate_metadata.outputs.name }}" ;; esac;162+ unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--bin ${{ steps.bin.outputs.BIN_NAME }}" ;; esac;163 echo "CARGO_TEST_OPTIONS=${CARGO_TEST_OPTIONS}" >> $GITHUB_OUTPUT164 165 - name: Run tests166 shell: bash191 unmodified lines