Process aliases #3926
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Copyright 2022 Paul Guyot <[email protected]> | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later | |
| # | |
| name: Pico Build | |
| on: | |
| push: | |
| paths: | |
| - '.github/workflows/pico-build.yaml' | |
| - 'CMakeLists.txt' | |
| - 'CMakeModules/**' | |
| - 'libs/**' | |
| - 'src/platforms/rp2/**' | |
| - 'src/platforms/esp32/test/main/test_erl_sources/test_crypto.erl' | |
| - 'src/libAtomVM/**' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/pico-build.yaml' | |
| - 'CMakeLists.txt' | |
| - 'CMakeModules/**' | |
| - 'libs/**' | |
| - 'src/platforms/rp2/**' | |
| - 'src/platforms/esp32/test/main/test_erl_sources/test_crypto.erl' | |
| - 'src/libAtomVM/**' | |
| permissions: | |
| actions: read | |
| contents: write | |
| security-events: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| pico: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| board: ["pico", "pico_w", "pico2"] | |
| platform: [""] | |
| jit: ["", "-DAVM_DISABLE_JIT=OFF"] | |
| include: | |
| - board: "pico2" | |
| platform: "-DPICO_PLATFORM=rp2350-riscv" | |
| jit: "" | |
| - board: "pico2" | |
| platform: "-DPICO_PLATFORM=rp2350-riscv" | |
| jit: "-DAVM_DISABLE_JIT=OFF" | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: "28.1" | |
| rebar3-version: "3.24.0" | |
| hexpm-mirrors: | | |
| https://builds.hex.pm | |
| https://repo.hex.pm | |
| https://cdn.jsdelivr.net/hex | |
| - 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 | |
| - name: Install riscv32 toolchain | |
| if: matrix.platform == '-DPICO_PLATFORM=rp2350-riscv' | |
| run: | | |
| sudo mkdir -p /opt/riscv32-toolchain | |
| cd /opt/riscv32-toolchain | |
| sudo wget -q https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.2.0-3/riscv-toolchain-15-x86_64-lin.tar.gz | |
| sudo tar xzf riscv-toolchain-15-x86_64-lin.tar.gz | |
| sudo rm riscv-toolchain-15-x86_64-lin.tar.gz | |
| echo "/opt/riscv32-toolchain/bin" >> $GITHUB_PATH | |
| - name: "Git config safe.directory for codeql" | |
| run: git config --global --add safe.directory /__w/AtomVM/AtomVM | |
| - name: "Initialize CodeQL" | |
| uses: github/codeql-action/init@v3 | |
| with: | |
| languages: "cpp" | |
| build-mode: manual | |
| queries: +./code-queries/term-to-non-term-func.ql,./code-queries/non-term-to-term-func.ql | |
| - name: Build | |
| shell: bash | |
| working-directory: ./src/platforms/rp2/ | |
| run: | | |
| set -euo pipefail | |
| mkdir build | |
| cd build | |
| cmake .. -G Ninja -DPICO_BOARD=${{ matrix.board }} ${{ matrix.platform }} ${{ matrix.jit }} | |
| ninja | |
| - name: "Perform CodeQL Analysis" | |
| uses: github/codeql-action/analyze@v3 | |
| - name: Install nvm and nodejs 20 | |
| if: matrix.board != 'pico2' | |
| run: | | |
| set -euo pipefail | |
| curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash | |
| source $HOME/.nvm/nvm.sh | |
| nvm install 20 | |
| - name: Build tests (without SMP) | |
| if: matrix.board != 'pico2' | |
| shell: bash | |
| working-directory: ./src/platforms/rp2/ | |
| run: | | |
| set -euo pipefail | |
| mkdir build.nosmp | |
| cd build.nosmp | |
| # TODO: fix all warnings and enable -DAVM_WARNINGS_ARE_ERRORS=ON | |
| cmake .. -G Ninja -DPICO_BOARD=${{ matrix.board }} ${{ matrix.jit }} -DAVM_DISABLE_SMP=1 | |
| cmake --build . --target=rp2_tests | |
| - name: Run tests with rp2040js | |
| if: matrix.board != 'pico2' | |
| shell: bash | |
| working-directory: ./src/platforms/rp2/tests | |
| run: | | |
| set -euo pipefail | |
| source $HOME/.nvm/nvm.sh | |
| nvm use node | |
| 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 == '' | |
| shell: bash | |
| run: | | |
| pushd src/platforms/rp2/build | |
| ATOMVM_UF2=AtomVM-${{ matrix.board }}-${{ github.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: Rename atomvmlib and write sha256sum | |
| if: startsWith(github.ref, 'refs/tags/') && matrix.board != 'pico_w' && 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}" | |
| sha256sum "${ATOMVMLIB_FILE}" > "${ATOMVMLIB_FILE}.sha256" | |
| popd | |
| - name: Release (Pico & Pico2) | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') && matrix.board != 'pico_w' && matrix.platform == '' && matrix.jit == '' | |
| with: | |
| draft: true | |
| fail_on_unmatched_files: true | |
| 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 | |
| build/libs/atomvmlib-${{ matrix.board }}-${{ github.ref_name }}.uf2 | |
| build/libs/atomvmlib-${{ matrix.board }}-${{ github.ref_name }}.uf2.sha256 | |
| - name: Release (PicoW) | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') && matrix.board == 'pico_w' && matrix.platform == '' && matrix.jit == '' | |
| with: | |
| draft: true | |
| fail_on_unmatched_files: true | |
| 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 |