cli/ota: Fix incorrectly quoted output and clippy warning #521
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
# This allows a subsequently queued workflow run to interrupt previous runs, but | |
# only in pull requests. | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.head_ref || github.sha }}' | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: -C strip=symbols -C target-feature=+crt-static | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
with: | |
# For git describe | |
fetch-depth: 0 | |
- name: Get version | |
id: get_version | |
shell: bash | |
run: | | |
echo -n 'version=' >> "${GITHUB_OUTPUT}" | |
git describe --always \ | |
| sed -E "s/^v//g;s/([^-]*-g)/r\1/;s/-/./g" \ | |
>> "${GITHUB_OUTPUT}" | |
- name: Get Rust target triple | |
id: get_target | |
shell: bash | |
run: | | |
echo -n 'name=' >> "${GITHUB_OUTPUT}" | |
rustc -vV | sed -n 's|host: ||p' >> "${GITHUB_OUTPUT}" | |
- name: Cache Rust dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Clippy | |
shell: bash | |
run: | | |
cargo clippy --release --workspace --features static \ | |
--target ${{ steps.get_target.outputs.name }} | |
- name: Build | |
shell: bash | |
run: | | |
cargo build --release --workspace --features static \ | |
--target ${{ steps.get_target.outputs.name }} | |
- name: Tests | |
shell: bash | |
run: | | |
cargo test --release --workspace --features static \ | |
--target ${{ steps.get_target.outputs.name }} | |
- name: End to end tests | |
shell: bash | |
run: | | |
cargo run --release -p e2e --features static \ | |
--target ${{ steps.get_target.outputs.name }} \ | |
-- test -a -c e2e/e2e.toml | |
# Due to https://github.com/rust-lang/rust/issues/78210, we have to use | |
# the --target option, which puts all output files in a different path. | |
# Symlink that path to the normal output directory so that we don't need | |
# to specify the Rust triple everywhere. | |
- name: Symlink target directory | |
shell: bash | |
run: | | |
rm -rf target/output | |
ln -s ${{ steps.get_target.outputs.name }}/release target/output | |
# This is done to ensure a flat directory structure. The upload-artifact | |
# action no longer allows multiple uploads to the same destination. | |
- name: Copy documentation to target directory | |
shell: bash | |
run: cp LICENSE README.md target/output/ | |
- name: Archive executable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: avbroot-${{ steps.get_version.outputs.version }}-${{ steps.get_target.outputs.name }} | |
path: | | |
target/output/LICENSE | |
target/output/README.md | |
target/output/avbroot | |
target/output/avbroot.exe |