Refactor http client and connection for better lifetime handling #141
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: | |
paths: | |
- .github/workflows/ci.yaml | |
- 'firmware/**' | |
pull_request: | |
paths: | |
- .github/workflows/ci.yaml | |
- 'firmware/**' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: riscv32imc-unknown-none-elf | |
components: clippy, rustfmt | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Cache cargo data | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/git | |
~/.cargo/registry | |
# intentionally not caching `target` here yet | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Check formatting | |
run: cargo fmt --all --check | |
working-directory: firmware | |
- name: Clippy | |
run: cargo clippy --workspace --all-targets -- --deny warnings --allow deprecated | |
working-directory: firmware | |
build: | |
name: Build | |
needs: [check] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: riscv32imc-unknown-none-elf | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Cache cargo data | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/git | |
~/.cargo/registry | |
# intentionally not caching `target` here yet | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build everything | |
run: cargo build --workspace --all-targets --release | |
working-directory: firmware | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: touch-n-drink-elf | |
path: firmware/target/riscv32imc-unknown-none-elf/release/touch-n-drink | |
if-no-files-found: error | |
image: | |
name: Image | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cache espflash | |
id: cache-espflash | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo/bin/espflash | |
key: ${{ runner.os }}-espflash | |
- name: Install dependencies | |
if: steps.cache-espflash.outputs.cache-hit != 'true' | |
run: sudo apt-get update && sudo apt-get install pkg-config libudev-dev | |
- name: Install espflash | |
if: steps.cache-espflash.outputs.cache-hit != 'true' | |
run: cargo install espflash | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: touch-n-drink-elf | |
- name: Generate ESP32 image | |
run: espflash save-image --chip esp32c3 --merge --skip-padding touch-n-drink touch-n-drink-esp32c3.bin | |
- name: Upload image artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: touch-n-drink-esp32c3 | |
path: touch-n-drink-esp32c3.bin | |
if-no-files-found: error |