Skip to content
Myr

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

1 file+16 added−7 removed

modified:.github/workflows/CICD.yml+16 added-7 removed
20 unmodified lines
21 - 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 }}4445 ensure_cargo_fmt:46 name: Ensure 'cargo fmt' has been run47 runs-on: ubuntu-20.04
74 unmodified lines
122123 - name: Show version information (Rust, cargo, GCC)124 shell: bash125 run: |126 set -x127 gcc --version || true128 rustup -V129 rustup toolchain list130 rustup default
14 unmodified lines
145 *-pc-windows-*) EXE_suffix=".exe" ;;146 esac;147148 # 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}"151152 # Let subsequent steps know where to find the binary153 echo "BIN_PATH=${BIN_PATH}" >> $GITHUB_OUTPUT
4 unmodified lines
158 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_OUTPUT164165 - name: Run tests166 shell: bash
191 unmodified lines