From 91a965735f8ac915cdf7fd41d30869bc128d7bf0 Mon Sep 17 00:00:00 2001 From: Kirill Mikhailov Date: Tue, 5 Mar 2024 18:47:01 +0100 Subject: [PATCH] update workflow --- .github/build_docs.sh | 17 +++++ .github/workflows/ci.yml | 25 ++++++++ resources/esp-rs.svg | 4 ++ resources/index.html | 132 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 178 insertions(+) create mode 100755 .github/build_docs.sh create mode 100644 resources/esp-rs.svg create mode 100644 resources/index.html diff --git a/.github/build_docs.sh b/.github/build_docs.sh new file mode 100755 index 00000000000..5d8ab1a01f4 --- /dev/null +++ b/.github/build_docs.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +WORKSPACE=${GITHUB_WORKSPACE:-$(pwd)} + +CHIPS=("esp32" "esp32c2" "esp32c3" "esp32c6" "esp32h2" "esp32p4" "esp32s2" "esp32s3") +for CHIP in "${CHIPS[@]}"; do + if [ "$CHIP" == "esp32" ] || [ "$CHIP" == "esp32s2" ] || [ "$CHIP" == "esp32s3" ]; then + cargo +esp xtask build-documentation --output-path=docs/"$CHIP"/ esp-hal "$CHIP" + else + cargo +nightly xtask build-documentation --output-path=docs/"$CHIP"/ esp-hal "$CHIP" + fi +done + +cp resources/esp-rs.svg "${WORKSPACE}" +cp resources/index.html "${WORKSPACE}" + +find . -maxdepth 1 -mindepth 1 ! -name 'docs' ! -name '.git' ! -name 'index.html' ! -name 'esp-rs.svg' ! -name '.' -exec rm -rf {} + \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a927afa28f..bbac986b8c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -296,3 +296,28 @@ jobs: run: cargo fmt --all --manifest-path=esp-riscv-rt/Cargo.toml -- --check - name: rustfmt (examples) run: cargo fmt --all --manifest-path=examples/Cargo.toml -- --check + + build-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@v1 + with: + target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf, riscv32imafc-unknown-none-elf + toolchain: ${{ env.MSRV }} + components: rust-src + + - uses: esp-rs/xtensa-toolchain@v1.5 + with: + default: true + ldproxy: false + + - name: Build and Clone Documentation + run: ./.github/build_docs.sh + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages + folder: . diff --git a/resources/esp-rs.svg b/resources/esp-rs.svg new file mode 100644 index 00000000000..d90b9eaf378 --- /dev/null +++ b/resources/esp-rs.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/index.html b/resources/index.html new file mode 100644 index 00000000000..559747e403c --- /dev/null +++ b/resources/index.html @@ -0,0 +1,132 @@ + + + + + +esp-rs docs + + + + + + + + +
+ + +
+ esp32 + Crate esp-hal (targeting ESP32) + 0.18.0 +
+ +
+ esp32c2 + Crate esp-hal (targeting ESP32-C2) + 0.13.0 +
+ +
+ esp32c3 + Crate esp-hal (targeting ESP32-C3) + 0.15.0 +
+ +
+ esp32c6 + Crate esp-hal (targeting ESP32-C6) + 0.8.0 +
+ +
+ esp32h2 + Crate esp-hal (targeting ESP32-H2) + 0.6.0 +
+ +
+ esp32p4 + Work in progress... + - +
+
+ esp32s2 + Crate esp-hal (targeting ESP32-S2) + 0.15.0 +
+ +
+ esp32s3 + Crate esp-hal (targeting ESP32-S3) + 0.15.0 +
+
+ + + \ No newline at end of file