diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7e4c289 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,91 @@ +name: Web Check + +permissions: + contents: read + +on: ["pull_request", "workflow_call"] + +jobs: + ci: + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest] + node: [24.19] + experimental: [false] + name: 👷 CI @qwik.dev/astro Node-${{ matrix.node }} under ${{ matrix.os }} + + steps: + - name: 🚚 Get latest code + uses: actions/checkout@v7 + + - name: Setp pnpm + uses: pnpm/action-setup@v6 + with: + version: 11 + + - name: 🎉 Setup Node.js + uses: actions/setup-node@v7 + with: + node-version: ${{ matrix.node }} + cache: 'pnpm' + cache-dependency-path: web/pnpm-lock.yaml + + - name: ✨ Install Frontend-dependencies + working-directory: web + run: | + corepack enable + pnpm install --frozen-lockfile + + - name: ✅ Check code style + working-directory: web + run: pnpm check + + - name: Build Frontend + working-directory: web + run: pnpm build + + - name: Check LittleFS-Partitions-size + working-directory: web + run: | + SIZE=$(du -sb dist | cut -f1) + LIMIT=$((2 * 1024 * 1024)) # 2 MB, eure littlefs-Partitionsgröße + echo "Frontend-Build: $((SIZE / 1024)) KB / $((LIMIT / 1024)) KB" + if [ "$SIZE" -gt "$LIMIT" ]; then + echo "::error::Frontend-Build (${SIZE} Byte) does not fit into littlefs-Partition (${LIMIT} Byte)!" + exit 1 + fi + + # + # --- Build Firmware (automatically bind web/dist over littlefs_create_partition_image) + # + + # https://github.com/actions/cache + - name: Cache ESP-IDF Preview + uses: actions/cache@v6 + with: + path: ~/esp-idf-preview + key: esp-idf-preview-102122904ad + + - name: Clone ESP-IDF Preview (if not in Cache) + run: | + if [ ! -d ~/esp-idf-preview/.git ]; then + git clone --recursive https://github.com/espressif/esp-idf.git ~/esp-idf-preview + cd ~/esp-idf-preview + git checkout 102122904ad + git submodule update --init --recursive + fi + + - name: Install Toolchain + run: | + cd ~/esp-idf-preview + ./install.sh esp32s31 + + - name: Build firmware + run: | + . ~/esp-idf-preview/export.sh + cd ot_br + idf.py --preview set-target esp32s31 + idf.py build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f97fe44..fb52e50 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,11 +58,10 @@ jobs: LIMIT=$((2 * 1024 * 1024)) # 2 MB, eure littlefs-Partitionsgröße echo "Frontend-Build: $((SIZE / 1024)) KB / $((LIMIT / 1024)) KB" if [ "$SIZE" -gt "$LIMIT" ]; then - echo "::error::Frontend-Build (${SIZE} Byte) überschreitet die littlefs-Partition (${LIMIT} Byte)!" + echo "::error::Frontend-Build (${SIZE} Byte) does not fit into littlefs-Partition (${LIMIT} Byte)!" exit 1 fi - # # --- Build Firmware (automatically bind web/dist over littlefs_create_partition_image) @@ -94,6 +93,8 @@ jobs: idf.py --preview set-target esp32s31 idf.py build -D PROJECT_VER=${GITHUB_REF_NAME} + ## create release + - name: Rename Artifacts run: | cd ot_br/build diff --git a/.github/workflows/web-check.yml b/.github/workflows/web-check.yml deleted file mode 100644 index 07c5a9e..0000000 --- a/.github/workflows/web-check.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Web Check - -permissions: - contents: read - -on: ["pull_request", "workflow_call"] - -jobs: - ci: - runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.experimental }} - strategy: - fail-fast: true - matrix: - os: [ubuntu-latest] - node: [24.19] - experimental: [false] - name: 👷 CI @qwik.dev/astro Node-${{ matrix.node }} under ${{ matrix.os }} - - steps: - - name: 🚚 Get latest code - uses: actions/checkout@v7 - - - name: Setp pnpm - uses: pnpm/action-setup@v6 - with: - version: 11 - - - name: 🎉 Setup Node.js - uses: actions/setup-node@v7 - with: - node-version: ${{ matrix.node }} - cache: 'pnpm' - cache-dependency-path: web/pnpm-lock.yaml - - - name: ✨ Install dependencies - working-directory: web - run: | - corepack enable - pnpm install - - - name: ✅ Check code style - working-directory: web - run: pnpm check \ No newline at end of file