From 9ab5e876c8dba21be22d7c9dda70696fca0bebe7 Mon Sep 17 00:00:00 2001 From: Peter M Date: Mon, 15 Sep 2025 10:17:51 +0200 Subject: [PATCH 1/2] CI: Fix pico, add combined uf2 & artifacts CI for release was using outdated way of building atomvmlib-pico.uf2/atomvmlib-pico2.uf2, fixed to the ninja building. Moved said building to a job before, the various pico builds. Removed wrong 'mv atomvmlib.uf2' segment, file is non-existent on new ninja builds. Added combined uf2 artifacts using uf2tool. Upload the artifacts, so they are available for testing. Include combined artifact in release. Signed-off-by: Peter M --- .github/workflows/pico-build.yaml | 107 ++++++++++++++++++++++++------ 1 file changed, 87 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pico-build.yaml b/.github/workflows/pico-build.yaml index 85bc16114..dc4cc7ad4 100644 --- a/.github/workflows/pico-build.yaml +++ b/.github/workflows/pico-build.yaml @@ -36,8 +36,46 @@ concurrency: cancel-in-progress: true jobs: + build-atomvmlib: + runs-on: ubuntu-24.04 + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: "apt update" + run: sudo apt update + + - name: "Install deps" + run: | + sudo apt install -y \ + cmake doxygen gperf ninja-build gcc-arm-none-eabi \ + libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib \ + erlang-base erlang-dev erlang-dialyzer erlang-eunit rebar3 + + - name: Build atomvmlib-pico.uf2/atomvmlib-pico2.uf2 + shell: bash + run: | + set -euo pipefail + mkdir build + cd build + cmake .. -G Ninja + cmake --build . -t atomvmlib + + - name: Upload atomvmlib artifacts + uses: actions/upload-artifact@v4 + with: + name: atomvmlib-uf2-files + path: build/libs/*.uf2 + + - name: Upload uf2tool artifact + uses: actions/upload-artifact@v4 + with: + name: uf2tool + path: build/tools/uf2tool/uf2tool + pico: runs-on: ubuntu-24.04 + needs: build-atomvmlib strategy: matrix: board: ["pico", "pico_w", "pico2"] @@ -65,6 +103,23 @@ jobs: https://repo.hex.pm https://cdn.jsdelivr.net/hex + - name: Set and escape ref name + shell: bash + run: | + echo "AVM_REF_NAME=${{ github.ref_name }}" | tr '/' '-' >> "$GITHUB_ENV"; + + - name: Download atomvmlib artifacts + uses: actions/download-artifact@v4 + with: + name: atomvmlib-uf2-files + path: build/libs/ + + - name: Download uf2tool artifact + uses: actions/download-artifact@v4 + with: + name: uf2tool + path: . + - name: "apt update" run: sudo apt update @@ -138,41 +193,49 @@ jobs: npm install npx tsx run-tests.ts ../build.nosmp/tests/rp2_tests.uf2 ../build.nosmp/tests/test_erl_sources/rp2_test_modules.uf2 - - name: Build atomvmlib.uf2 - if: startsWith(github.ref, 'refs/tags/') && matrix.board != 'pico_w' && matrix.platform == '' && matrix.jit == '' - shell: bash - run: | - set -euo pipefail - mkdir build - cd build - cmake .. - make atomvmlib-${{ matrix.board }}.uf2 - - name: Rename AtomVM and write sha256sum - if: startsWith(github.ref, 'refs/tags/') && matrix.platform == '' && matrix.jit == '' + if: matrix.platform == '' && matrix.jit == '' shell: bash run: | pushd src/platforms/rp2/build - ATOMVM_UF2=AtomVM-${{ matrix.board }}-${{ github.ref_name }}.uf2 + ATOMVM_UF2=AtomVM-${{ matrix.board }}-${{env.AVM_REF_NAME}}.uf2 mv src/AtomVM.uf2 "src/${ATOMVM_UF2}" sha256sum "src/${ATOMVM_UF2}" > "src/${ATOMVM_UF2}.sha256" popd - pushd build/libs - ATOMVMLIB_FILE=atomvmlib-${{ matrix.board }}-${{ github.ref_name }}.uf2 - mv atomvmlib.uf2 "${ATOMVMLIB_FILE}" - sha256sum "${ATOMVMLIB_FILE}" > "${ATOMVMLIB_FILE}.sha256" - popd + + - name: Upload AtomVM artifact + if: matrix.platform == '' && matrix.jit == '' + uses: actions/upload-artifact@v4 + with: + name: AtomVM-${{ matrix.board }}-${{env.AVM_REF_NAME}}.uf2 + path: src/platforms/rp2/build/src/AtomVM-${{ matrix.board }}-*.uf2 - name: Rename atomvmlib and write sha256sum - if: startsWith(github.ref, 'refs/tags/') && matrix.board != 'pico_w' && matrix.platform == '' && matrix.jit == '' + if: matrix.platform == '' && matrix.jit == '' shell: bash run: | pushd build/libs - ATOMVMLIB_FILE=atomvmlib-${{ matrix.board }}-${{ github.ref_name }}.uf2 - mv atomvmlib-${{ matrix.board }}.uf2 "${ATOMVMLIB_FILE}" + ATOMVMLIB_FILE=atomvmlib-${{ matrix.board }}-${{env.AVM_REF_NAME}}.uf2 + mv atomvmlib-${{matrix.board == 'pico_w' && 'pico' || matrix.board}}.uf2 "${ATOMVMLIB_FILE}" sha256sum "${ATOMVMLIB_FILE}" > "${ATOMVMLIB_FILE}.sha256" popd + - name: Combine uf2 using uf2tool + if: matrix.platform == '' && matrix.jit == '' + shell: bash + run: | + ATOMVM_COMBINED_FILE=AtomVM-combined-${{ matrix.board }}-${{env.AVM_REF_NAME}}.uf2 + ./uf2tool join -o "${ATOMVM_COMBINED_FILE}" src/platforms/rp2/build/src/AtomVM-${{ matrix.board }}-${{env.AVM_REF_NAME}}.uf2 build/libs/atomvmlib-${{ matrix.board }}-${{env.AVM_REF_NAME}}.uf2 + sha256sum "${ATOMVM_COMBINED_FILE}" > "${ATOMVM_COMBINED_FILE}.sha256" + echo "ATOMVM_COMBINED_FILE=${ATOMVM_COMBINED_FILE}" >> $GITHUB_ENV + + - name: Upload combined AtomVM artifact + if: matrix.platform == '' && matrix.jit == '' + uses: actions/upload-artifact@v4 + with: + name: ${{ env.ATOMVM_COMBINED_FILE }} + path: ${{ env.ATOMVM_COMBINED_FILE }} + - name: Release (Pico & Pico2) uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') && matrix.board != 'pico_w' && matrix.platform == '' && matrix.jit == '' @@ -184,6 +247,8 @@ jobs: src/platforms/rp2/build/src/AtomVM-${{ matrix.board }}-${{ github.ref_name }}.uf2.sha256 build/libs/atomvmlib-${{ matrix.board }}-${{ github.ref_name }}.uf2 build/libs/atomvmlib-${{ matrix.board }}-${{ github.ref_name }}.uf2.sha256 + ${{ env.ATOMVM_COMBINED_FILE }} + ${{ env.ATOMVM_COMBINED_FILE }}.sha256 - name: Release (PicoW) uses: softprops/action-gh-release@v1 @@ -194,3 +259,5 @@ jobs: files: | src/platforms/rp2/build/src/AtomVM-${{ matrix.board }}-${{ github.ref_name }}.uf2 src/platforms/rp2/build/src/AtomVM-${{ matrix.board }}-${{ github.ref_name }}.uf2.sha256 + ${{ env.ATOMVM_COMBINED_FILE }} + ${{ env.ATOMVM_COMBINED_FILE }}.sha256 From 8e61eb0d26d6f526de94c3d514bd42a5264d5ef6 Mon Sep 17 00:00:00 2001 From: Peter M Date: Fri, 12 Dec 2025 18:03:33 +0100 Subject: [PATCH 2/2] CI: pico codeql v4 Signed-off-by: Peter M --- .github/workflows/pico-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pico-build.yaml b/.github/workflows/pico-build.yaml index dc4cc7ad4..685ab0bae 100644 --- a/.github/workflows/pico-build.yaml +++ b/.github/workflows/pico-build.yaml @@ -143,7 +143,7 @@ jobs: run: git config --global --add safe.directory /__w/AtomVM/AtomVM - name: "Initialize CodeQL" - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: "cpp" build-mode: manual @@ -160,7 +160,7 @@ jobs: ninja - name: "Perform CodeQL Analysis" - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 - name: Install nvm and nodejs 20 if: matrix.board != 'pico2'