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 to new crates; simplify advanced options #159

Merged
merged 59 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
15062de
Revert "Revert "Update to new crates; simplify advanced options""
ivmarkov Oct 17, 2023
8dbdcbb
Integrate the article of @georgik
ivmarkov Oct 17, 2023
894ba6c
Fix cargo CI
ivmarkov Oct 17, 2023
f7cbc0d
Reorder std and hal
ivmarkov Oct 17, 2023
5cc1aef
Update Rust MSRV
ivmarkov Oct 17, 2023
fd2a657
Fix a typo
ivmarkov Oct 17, 2023
747c05f
Fix a typo
ivmarkov Oct 17, 2023
a88da61
Make the job name a tad more readable
ivmarkov Oct 17, 2023
3d74ea5
Remove unnecessary forgotten if
ivmarkov Oct 17, 2023
2075182
Similar changes as the ones in the cargo CI
ivmarkov Oct 17, 2023
0a14d31
main function necessary
ivmarkov Oct 17, 2023
7cc8aed
main function necessary
ivmarkov Oct 17, 2023
162bdce
Forgotten name of build job
ivmarkov Oct 17, 2023
6cb0c21
Merge v5.1 and 4.4 checks to avoid code duplication
ivmarkov Oct 17, 2023
4c89bf5
hal option is unnecessary
ivmarkov Oct 17, 2023
dbb3cdd
hal option is unnecessary
ivmarkov Oct 17, 2023
6e25476
hal option is unnecessary; 5.1 default everywhere
ivmarkov Oct 17, 2023
437f5e0
hal option is unnecessary
ivmarkov Oct 17, 2023
76de4d2
hal option is unnecessary; 5.1 default for all MCUs
ivmarkov Oct 17, 2023
b55c133
More MCUs
ivmarkov Oct 17, 2023
548f1b9
hal option not necessary
ivmarkov Oct 17, 2023
41c6e20
Remove forgotten closing if
ivmarkov Oct 17, 2023
a598974
Fix typo causing v4.4 to miscompile
ivmarkov Oct 17, 2023
0f807d8
Forgotten advanced variable
ivmarkov Oct 17, 2023
b5a2b05
Fix cmake build
ivmarkov Oct 17, 2023
a9b87d7
Wrong syntax
ivmarkov Oct 17, 2023
145d5af
Actually not necessary
ivmarkov Oct 17, 2023
df190ad
Temporarily enable the esp-adc component
ivmarkov Oct 17, 2023
a2b64d4
Fix devcontainer CI
ivmarkov Oct 17, 2023
cb4335f
Misspelled comp name
ivmarkov Oct 17, 2023
0e94277
Trigger less builds on PRs
ivmarkov Oct 17, 2023
03c2dfe
Purely-computational crates need a panic handler
ivmarkov Oct 17, 2023
49a51f5
Branch by arch in cmake generation
ivmarkov Oct 17, 2023
93da858
rhai not necessary for cmake build
ivmarkov Oct 18, 2023
02f5f49
Get rid of blank spaces
ivmarkov Oct 18, 2023
2a69080
Get rid of blank spaces
ivmarkov Oct 18, 2023
ed6c7aa
Get rid of the blank lines
ivmarkov Oct 18, 2023
6555b9c
Get rid of the blank lines
ivmarkov Oct 18, 2023
b0dfefe
Fix wording
ivmarkov Oct 18, 2023
c6f4e97
The template does not have not??
ivmarkov Oct 18, 2023
d670916
Properly qualify PanicInfo
ivmarkov Oct 18, 2023
cb1fb72
Fix formatting
ivmarkov Oct 18, 2023
0116e64
Check with latest esp-idf-hal
ivmarkov Oct 18, 2023
72cee6f
remove libstart - not necessary
ivmarkov Oct 18, 2023
78b321d
Assign correct Rust target so newer MCUs
ivmarkov Oct 18, 2023
21c7a8b
Try with new embedded-svc
ivmarkov Oct 18, 2023
6d71a63
Add MCU to the cargo config
ivmarkov Oct 18, 2023
01b55d3
Set MCU for the CMake build as well
ivmarkov Oct 18, 2023
cbc4387
Missing quotes
ivmarkov Oct 19, 2023
5637922
Clarify comment
ivmarkov Oct 19, 2023
1dad957
Article reworked from step-by-step guide to explaining the project ar…
ivmarkov Oct 19, 2023
f31bfb1
Remove crates patching
ivmarkov Oct 19, 2023
6319567
Wording fixes
ivmarkov Oct 19, 2023
e1b062d
Try latest esp-idf-sys
ivmarkov Oct 19, 2023
0815db8
Try with resolver 2
ivmarkov Oct 19, 2023
2ed688b
Remove the binstart feature
ivmarkov Oct 19, 2023
da4b60f
Update old links; add more MCUs
ivmarkov Oct 19, 2023
f59b2a0
Update README-cmake-details.md
ivmarkov Oct 19, 2023
8adb222
Accommodate review feedback
ivmarkov Oct 19, 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
110 changes: 18 additions & 92 deletions .github/workflows/ci_cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Cargo CI

on:
push:
branches:
- master
paths:
- "cargo/**"
- ".github/workflows/ci_cargo.yml"
Expand All @@ -18,95 +20,20 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
cargo-checks-v5:
name: "${{ matrix.target }} | ${{ matrix.esp-idf.version }} | std(hal):${{ matrix.std-config.std }}(${{ matrix.std-config.hal }})"
checks:
name: "${{ matrix.target }} | ${{ matrix.esp-idf.version }} | std=${{ matrix.std-config.std }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: ["esp32", "esp32c3", esp32c2, esp32c6, esp32h2, "esp32s2", "esp32s3"]
target: ["esp32", "esp32c3", "esp32c2", "esp32c6", "esp32h2", "esp32s2", "esp32s3"]
std-config:
- std: false
- std: true
hal: "No"
- std: true
hal: "Yes (default features)"
- std: true
hal: "Yes (all features)"
esp-idf:
- version: v5.1
# - version: master
# name: master
steps:
- name: Setup | Rust (RISC-V)
if: matrix.target != 'esp32' && matrix.target != 'esp32s2' && matrix.target != 'esp32s3'
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
components: clippy, rustfmt, rust-src
- name: Setup | Rust (Xtensa)
if: matrix.target == 'esp32' || matrix.target == 'esp32s2' || matrix.target == 'esp32s3'
uses: esp-rs/[email protected]
with:
default: true
buildtargets: ${{ matrix.target }}
ldproxy: false
version: "1.69.0"
- uses: Swatinem/rust-cache@v2
- name: Setup | cargo-generate (binary)
id: cargo-generate-binary
continue-on-error: true
run: |
sudo curl -L "https://github.com/cargo-generate/cargo-generate/releases/latest/download/cargo-generate-$(git ls-remote --refs --sort="version:refname" --tags "https://github.com/cargo-generate/cargo-generate" | cut -d/ -f3- | tail -n1)-x86_64-unknown-linux-gnu.tar.gz" -o "/home/runner/.cargo/bin/cargo-generate.tar.gz"
tar xf "/home/runner/.cargo/bin/cargo-generate.tar.gz" -C /home/runner/.cargo/bin
chmod u+x /home/runner/.cargo/bin/cargo-generate
- name: Setup | cargo-generate (cargo)
if: steps.cargo-generate-binary.outcome != 'success'
run: cargo install cargo-generate
- name: Setup | ldproxy (binary)
id: ldproxy-binary
continue-on-error: true
run: |
sudo curl -L "https://github.com/esp-rs/embuild/releases/latest/download/ldproxy-x86_64-unknown-linux-gnu.zip" -o "/home/runner/.cargo/bin/ldproxy.zip"
unzip "/home/runner/.cargo/bin/ldproxy.zip" -d "/home/runner/.cargo/bin/"
chmod u+x /home/runner/.cargo/bin/ldproxy
- name: Setup | ldproxy (cargo)
if: steps.ldproxy-binary.outcome != 'success'
run: cargo install ldproxy
- uses: actions/checkout@v4
with:
path: /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template
- name: Generate (STD)
if: matrix.std-config.std == true
run: cargo generate --path /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template cargo --name test --vcs none --silent -d mcu=${{ matrix.target }} -d advanced=true -d espidfver=${{ matrix.esp-idf.version }} -d std=${{ matrix.std-config.std }} -d hal="${{ matrix.std-config.hal }}" -d devcontainer=false -d wokwi=false -d ci=false
- name: Generate (No STD)
if: matrix.std-config.std == false
run: cargo generate --path /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template cargo --name test --vcs none --silent -d mcu=${{ matrix.target }} -d advanced=true -d espidfver=${{ matrix.esp-idf.version }} -d std=${{ matrix.std-config.std }} -d devcontainer=false -d wokwi=false -d ci=false
- name: Build | Fmt Check (RISC-V)
if: matrix.target != 'esp32' && matrix.target != 'esp32s2' && matrix.target != 'esp32s3'
run: cd test; cargo fmt -- --check
- name: Build | Clippy (RISC-V)
if: matrix.target != 'esp32' && matrix.target != 'esp32s2' && matrix.target != 'esp32s3'
run: cd test; cargo clippy --no-deps -- -Dwarnings
- name: Build | Compile
run: cd test; cargo build
cargo-checks-v4:
name: "${{ matrix.target }} | ${{ matrix.esp-idf.version }} | std(hal):${{ matrix.std-config.std }}(${{ matrix.std-config.hal }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: ["esp32", "esp32c3", "esp32s2", "esp32s3"]
std-config:
- std: false
- std: true
hal: "No"
- std: true
hal: "Yes (default features)"
- std: true
hal: "Yes (all features)"
esp-idf:
- version: v5.1
- version: v4.4
# - version: master
steps:
- name: Setup | Rust (RISC-V)
if: matrix.target != 'esp32' && matrix.target != 'esp32s2' && matrix.target != 'esp32s3'
Expand All @@ -121,6 +48,7 @@ jobs:
default: true
buildtargets: ${{ matrix.target }}
ldproxy: false
version: "1.71.0"
- uses: Swatinem/rust-cache@v2
- name: Setup | cargo-generate (binary)
id: cargo-generate-binary
Expand All @@ -145,21 +73,19 @@ jobs:
- uses: actions/checkout@v4
with:
path: /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template
- name: Generate (STD)
if: matrix.std-config.std == true
run: cargo generate --path /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template cargo --name test --vcs none --silent -d mcu=${{ matrix.target }} -d advanced=true -d espidfver=${{ matrix.esp-idf.version }} -d std=${{ matrix.std-config.std }} -d hal="${{ matrix.std-config.hal }}" -d devcontainer=false -d wokwi=false -d ci=false
- name: Generate (No STD)
if: matrix.std-config.std == false
- name: Generate
if: matrix.esp-idf.version != 'v4.4' || matrix.target == 'esp32' || matrix.target == 'esp32s2' || matrix.target == 'esp32s3' || matrix.target == 'esp32c3'
run: cargo generate --path /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template cargo --name test --vcs none --silent -d mcu=${{ matrix.target }} -d advanced=true -d espidfver=${{ matrix.esp-idf.version }} -d std=${{ matrix.std-config.std }} -d devcontainer=false -d wokwi=false -d ci=false
- name: Build | Fmt Check (RISC-V)
if: matrix.target != 'esp32' && matrix.target != 'esp32s2' && matrix.target != 'esp32s3'
- name: Build | Fmt Check
if: matrix.esp-idf.version == 'v4.4' && matrix.target == 'esp32c3'
run: cd test; cargo fmt -- --check
- name: Build | Clippy (RISC-V)
if: matrix.target != 'esp32' && matrix.target != 'esp32s2' && matrix.target != 'esp32s3'
- name: Build | Clippy
if: matrix.esp-idf.version != 'v4.4' || matrix.target == 'esp32' || matrix.target == 'esp32s2' || matrix.target == 'esp32s3' || matrix.target == 'esp32c3'
run: cd test; cargo clippy --no-deps -- -Dwarnings
- name: Build | Compile
if: matrix.esp-idf.version != 'v4.4' || matrix.target == 'esp32' || matrix.target == 'esp32s2' || matrix.target == 'esp32s3' || matrix.target == 'esp32c3'
run: cd test; cargo build
container-check:
container-checks:
name: "Container Check: ${{ matrix.target }}"
runs-on: ubuntu-latest
strategy:
Expand All @@ -183,8 +109,8 @@ jobs:
- uses: actions/checkout@v4
with:
path: /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template
- name: Generate Project
run: cargo generate --path /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template cargo --name test-${{ matrix.target }} --vcs none --silent -d mcu=${{ matrix.target }} -d espidfver=v4.4 -d advanced=true -d std=true -d hal="Yes (default features)" -d devcontainer=true -d wokwi=false -d ci=false
- name: Generate
run: cargo generate --path /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template cargo --name test-${{ matrix.target }} --vcs none --silent -d mcu=${{ matrix.target }} -d advanced=true -d espidfver=v5.1 -d std=true -d devcontainer=true -d wokwi=false -d ci=false
- name: Update ownership
run: |
sudo chown 1000:1000 -R test-${{ matrix.target }}
Expand Down
50 changes: 26 additions & 24 deletions .github/workflows/ci_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: CMake CI

on:
push:
branches:
- master
paths:
- "cmake/**"
- ".github/workflows/ci_cmake.yml"
Expand All @@ -19,47 +21,52 @@ env:

jobs:
cmake-checks:
name: "${{ matrix.target.board }} | ${{ matrix.esp-idf.version }} | std(hal):${{ matrix.std-config.std }}(${{ matrix.std-config.hal }}))"
name: "${{ matrix.target.mcu }} | ${{ matrix.esp-idf.version }} | hal=${{ matrix.std-config.hal }} | std=${{ matrix.std-config.std }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- board: "esp32"
- mcu: "esp32"
toolchain: "esp"
- board: "esp32s2"
- mcu: "esp32s2"
toolchain: "esp"
- board: "esp32s3"
- mcu: "esp32s3"
toolchain: "esp"
- board: "esp32c3"
- mcu: "esp32c3"
toolchain: "nightly"
- mcu: "esp32c2"
toolchain: "nightly"
- mcu: "esp32c6"
toolchain: "nightly"
- mcu: "esp32h2"
toolchain: "nightly"
std-config:
- std: false
- std: true
hal: "No"
- std: true
hal: "Yes (default features)"
- std: true
hal: "Yes (all features)"
- hal: true
std: true
- hal: true
std: false
- hal: false
std: false
esp-idf:
- version: v5.1
# - version: master
# name: master
steps:
- name: Setup | Rust (RISC-V)
if: matrix.target.board != 'esp32' && matrix.target.board != 'esp32s2' && matrix.target.board != 'esp32s3'
if: matrix.target.mcu != 'esp32' && matrix.target.mcu != 'esp32s2' && matrix.target.mcu != 'esp32s3'
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
components: clippy, rustfmt, rust-src
- name: Setup | Rust (Xtensa)
if: matrix.target.board == 'esp32' || matrix.target.board == 'esp32s2' || matrix.target.board == 'esp32s3'
if: matrix.target.mcu == 'esp32' || matrix.target.mcu == 'esp32s2' || matrix.target.mcu == 'esp32s3'
uses: esp-rs/[email protected]
with:
default: true
buildtargets: ${{ matrix.target.board }}
buildtargets: ${{ matrix.target.mcu }}
ldproxy: false
version: "1.69.0"
version: "1.71.0"
- uses: Swatinem/rust-cache@v2
- name: Setup | cargo-generate (binary)
id: cargo-generate-binary
Expand All @@ -84,18 +91,13 @@ jobs:
- uses: actions/checkout@v4
with:
path: /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template
- name: Generate (STD)
if: matrix.std-config.std == true
run: cargo generate --path /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template cmake --name test --vcs none --silent -d toolchain=${{ matrix.target.toolchain }} -d std=${{ matrix.std-config.std }} -d espidfver=${{ matrix.esp-idf.version }} -d hal="${{ matrix.std-config.hal }}"
- name: Generate (No STD)
if: matrix.std-config.std == false
run: cargo generate --path /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template cmake --name test --vcs none --silent -d toolchain=${{ matrix.target.toolchain }} -d std=${{ matrix.std-config.std }} -d espidfver=${{ matrix.esp-idf.version }}
- name: Generate
run: cargo generate --path /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template cmake --name test --vcs none --silent -d toolchain=${{ matrix.target.toolchain }} -d advanced=true -d hal=${{ matrix.std-config.hal }} -d std=${{ matrix.std-config.std }} -d espidfver=${{ matrix.esp-idf.version }}
- name: ESP-IDF | Checkout
run: git clone https://github.com/espressif/esp-idf; git -C esp-idf checkout ${{ matrix.esp-idf.version }}
- name: ESP-IDF | Install Tooling
run: esp-idf/install.sh
- name: Build | Set Target
run: . esp-idf/export.sh; cd test; idf.py set-target ${{ matrix.target.board }}
run: . esp-idf/export.sh; cd test; idf.py set-target ${{ matrix.target.mcu }}
- name: Build | Compile
run: . esp-idf/export.sh; cd test; idf.py build

Loading