Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation #368

Merged
merged 38 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
dbe4d89
ci: ✨ Add Rasberry CI
SergioGasquez Oct 4, 2022
a89b6f4
ci: 🐛 Fix typo
SergioGasquez Oct 4, 2022
a21b484
ci: 🐛 Fix args order
SergioGasquez Oct 4, 2022
8580fa0
ci: 🐛 Fix args order
SergioGasquez Oct 4, 2022
89f76fa
ci: ⬆️ Bump actions/checkout
SergioGasquez Feb 2, 2023
5f79d13
ci: ⬆️ Bump Swatinem/rust-cache
SergioGasquez Feb 2, 2023
9d38af9
ci: ⚡️ Avoid using actions-rs
SergioGasquez Feb 2, 2023
c1ef7e3
ci: ⚡️ Replace actions-rs/toolchain by dtolnay/rust-toolchain
SergioGasquez Feb 2, 2023
4669ac0
ci: ⚡️ Fix CI warnings
SergioGasquez Feb 2, 2023
019cd61
ci: 🎨 Fix inputs
SergioGasquez Feb 2, 2023
86881d2
ci: ⚡️ Update mad9000/actions-find-and-replace-string and remove acti…
SergioGasquez Feb 2, 2023
aa42bd2
ci: ⚡️ Update mad9000/actions-find-and-replace-string and remove acti…
SergioGasquez Feb 2, 2023
a650d61
Merge branch 'esp-rs:main' into master
SergioGasquez Mar 18, 2023
d80501e
style: 🚨 Fix clippy warning
SergioGasquez Mar 18, 2023
aa8d25a
docs: 🎨 Fix links
SergioGasquez Mar 18, 2023
52c08dc
build: 🎨 Format includes
SergioGasquez Mar 18, 2023
16647c6
style: 🎨 Sort dependencies
SergioGasquez Mar 18, 2023
8220c00
build: ⬆️ Bump dependencies
SergioGasquez Mar 18, 2023
d55596c
build: ⬆️ Bump dependencies
SergioGasquez Mar 18, 2023
d24c5d5
ci: ⚡️ Fail if there is a clippy warning
SergioGasquez Mar 18, 2023
edf8e88
docs: 📝 Remove docstrings
SergioGasquez Mar 18, 2023
b0c8c47
docs: 📝 Update docstrings
SergioGasquez Mar 18, 2023
d775e22
docs: 📝 Update monitor docstrings
SergioGasquez Mar 18, 2023
b685548
docs: 📝 Update monitor docstrings
SergioGasquez Mar 18, 2023
77520a7
docs: 📝 Update config docstrings
SergioGasquez Mar 18, 2023
4d73b86
docs: 📝 Update cli mod docstrings
SergioGasquez Mar 18, 2023
a198790
docs: 📝 Update docstrings
SergioGasquez Mar 18, 2023
002310c
style: 🔊 Update log
SergioGasquez Mar 18, 2023
aa0947f
revert: ⏪️ Revert cargo version upgrade
SergioGasquez Mar 18, 2023
f6ad642
revert: ⏪️ Revert cargo version upgrade
SergioGasquez Mar 18, 2023
67378de
ci: ⚡️ Fail on clippy warnings
SergioGasquez Mar 18, 2023
1645731
build: ⬇️ Downgrade dependencies to maintain msrv
SergioGasquez Mar 20, 2023
0b74729
build: ⏪️ Rever pinned dependency
SergioGasquez Mar 20, 2023
533a072
Merge branch 'main' into master
SergioGasquez Mar 24, 2023
d18d92f
Update espflash/src/flasher/mod.rs
SergioGasquez Mar 24, 2023
ddb4556
Merge branch 'master' of https://github.com/SergioGasquez/espflash
SergioGasquez Mar 24, 2023
0a823ec
docs: 📝 Add refences to types
SergioGasquez Mar 24, 2023
345b2db
docs: 📝 Fix typo
SergioGasquez Mar 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 155 additions & 0 deletions .github/workflows/raspberry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Rasberry Pi

on:
pull_request:
branches:
- master
push:
workflow_dispatch:
workflow_call:
inputs:
target:
required: true
type: string
arch:
required: false
default: ""
type: string

env:
CARGO_TERM_COLOR: always

jobs:
publish-release:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
crate: ["espflash", "cargo-espflash"]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ inputs.target }}
override: true
- uses: Swatinem/rust-cache@v1
- name: Replace target string
uses: mad9000/actions-find-and-replace-string@1
id: findandreplace
with:
source: ${{ inputs.target }}
find: "unknown-"
replace: ""
- name: Build dependencies
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update
echo "deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ubuntu-ports focal main universe" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ubuntu-ports focal-updates main universe" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo dpkg --add-architecture ${{ inputs.arch }}
sudo apt-get install -y curl git libudev-dev musl-tools pkg-config "libudev1:${{ inputs.arch }}" "libgcc-s1:${{ inputs.arch }}" "libc6:${{ inputs.arch }}" "libudev-dev:${{ inputs.arch }}" gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf gcc-aarch64-linux-gnu pkg-config-aarch64-linux-gnu
echo "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0" >> $GITHUB_ENV
echo "PKG_CONFIG_DIR=/opt/" >> $GITHUB_ENV
echo "PKG_CONFIG_LIBDIR=/opt/usr/lib/pkgconfig:/opt/usr/share/pkgconfig" >> $GITHUB_ENV
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
if [[ ${{ inputs.arch }} == arm64 ]]; then
echo "PKG_CONFIG_PATH=/usr/lib/${{ steps.findandreplace.outputs.value }}/pkgconfig" >> $GITHUB_ENV
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=${{ steps.findandreplace.outputs.value }}-gcc" >> $GITHUB_ENV
fi
if [[ ${{ inputs.arch }} == armhf ]]; then
echo "PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig" >> $GITHUB_ENV
echo "CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV
fi
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all --target ${{ inputs.target }} --features=raspberry
- name: Compress
run: zip -j ${{ matrix.crate }}-${{ inputs.target }}.zip target/${{ inputs.target }}/release/${{ matrix.crate }}${{ inputs.extension }}
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.crate }}-${{ inputs.target }}.zip
tag: ${{ github.ref }}

rust-ci:
if: github.event_name != 'workflow_dispatch'
name: "Rust CI: ${{ matrix.job.name }} - ${{ matrix.board.target }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board:
- target: armv7-unknown-linux-gnueabihf
arch: armhf
- target: aarch64-unknown-linux-gnu
arch: arm64
job:
- name: Check
toolchain: stable
cargo-command: check
args: --features=raspberry
- name: Check MSRV
toolchain: "1.60"
cargo-command: check
args: --features=raspberry
- name: Unit Test
toolchain: stable
cargo-command: test
args: --lib --features=raspberry
- name: Rustfmt
toolchain: stable
components: rustfmt
cargo-command: fmt
args: --all -- --check
- name: Clippy
toolchain: stable
components: clippy
cargo-command: clippy
args: -- -A clippy::too_many_arguments
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.job.toolchain }}
target: ${{ matrix.board.target }}
components: ${{ matrix.job.components }}
override: true
- uses: Swatinem/rust-cache@v1
- name: Replace target string
uses: mad9000/actions-find-and-replace-string@1
id: findandreplace
with:
source: ${{ matrix.board.target }}
find: "unknown-"
replace: ""
- name: Build dependencies
if: matrix.job.cargo-command != 'fmt'
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update
echo "deb [arch=${{ matrix.board.arch }}] http://ports.ubuntu.com/ubuntu-ports focal main universe" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=${{ matrix.board.arch }}] http://ports.ubuntu.com/ubuntu-ports focal-updates main universe" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo dpkg --add-architecture ${{ matrix.board.arch }}
sudo apt-get install -y curl git libudev-dev musl-tools pkg-config "libudev1:${{ matrix.board.arch }}" "libgcc-s1:${{ matrix.board.arch }}" "libc6:${{ matrix.board.arch }}" "libudev-dev:${{ matrix.board.arch }}" gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf gcc-aarch64-linux-gnu pkg-config-aarch64-linux-gnu
echo "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0" >> $GITHUB_ENV
echo "PKG_CONFIG_DIR=/opt/" >> $GITHUB_ENV
echo "PKG_CONFIG_LIBDIR=/opt/usr/lib/pkgconfig:/opt/usr/share/pkgconfig" >> $GITHUB_ENV
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
if [[ ${{ matrix.board.arch }} == arm64 ]]; then
echo "PKG_CONFIG_PATH=/usr/lib/${{ steps.findandreplace.outputs.value }}/pkgconfig" >> $GITHUB_ENV
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=${{ steps.findandreplace.outputs.value }}-gcc" >> $GITHUB_ENV
fi
if [[ ${{ matrix.board.arch }} == armhf ]]; then
echo "PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig" >> $GITHUB_ENV
echo "CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV
fi
- uses: actions-rs/cargo@v1
with:
command: ${{ matrix.job.cargo-command }}
args: ${{ matrix.job.args }}
2 changes: 1 addition & 1 deletion .github/workflows/raspberry_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
toolchain: stable
components: clippy
cargo-command: clippy
args: --features=raspberry -- -A clippy::too_many_arguments
args: --features=raspberry -- -D warnings -A clippy::too_many_arguments
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ jobs:
components: clippy
- uses: Swatinem/rust-cache@v2
# `too_many_arguments` is relatively arbitrary
- run: cargo clippy -- -A clippy::too_many_arguments
- run: cargo clippy -- -A clippy::too_many_arguments -D warnings
89 changes: 84 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 3 additions & 11 deletions cargo-espflash/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
[package]
name = "cargo-espflash"
version = "2.0.0-rc.3"
authors = [
"Robin Appelman <[email protected]>",
"Jesse Braham <[email protected]>",
]
authors = ["Robin Appelman <[email protected]>", "Jesse Braham <[email protected]>"]
edition = "2021"
rust-version = "1.64"
description = "Cargo subcommand for flashing Espressif devices over serial"
repository = "https://github.com/esp-rs/espflash"
license = "MIT OR Apache-2.0"
keywords = [
"cargo",
"cli",
"embedded",
"esp",
]
keywords = ["cargo", "cli", "embedded", "esp"]
categories = [
"command-line-utilities",
"development-tools",
Expand All @@ -33,7 +25,7 @@ cargo = { version = "0.66.0", features = ["vendored-openssl"] }
cargo_metadata = "0.15.2"
clap = { version = "4.0.32", features = ["derive"] }
env_logger = "0.10.0"
esp-idf-part = "0.1.2"
esp-idf-part = "0.2.0"
espflash = { version = "=2.0.0-rc.3", path = "../espflash" }
log = "0.4.17"
miette = { version = "5.5.0", features = ["fancy"] }
Expand Down
2 changes: 0 additions & 2 deletions cargo-espflash/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ enum CargoSubcommand {

#[derive(Debug, Subcommand)]
enum Commands {
/// Display information about the connected board and exit without flashing
BoardInfo(ConnectArgs),
/// Flash an application to a target device
Flash(FlashArgs),
Monitor(MonitorArgs),
PartitionTable(PartitionTableArgs),
Expand Down
Loading