Fix C++ compilation #2006
Workflow file for this run
This file contains 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: STM32 Build | |
on: | |
push: | |
paths: | |
- '.github/workflows/stm32-build.yaml' | |
- 'CMakeLists.txt' | |
- 'src/platforms/stm32/**' | |
- 'src/libAtomVM/**' | |
pull_request: | |
paths: | |
- '.github/workflows/stm32-build.yaml' | |
- 'CMakeLists.txt' | |
- 'src/platforms/stm32/**' | |
- 'src/libAtomVM/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
stm32: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/cache@v3 | |
id: builddeps-cache | |
with: | |
path: | | |
/home/runner/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi | |
/home/runner/libopencm3 | |
key: ${{ runner.os }}-build-deps | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: "26" | |
- name: Install arm-embedded toolchain | |
if: ${{ steps.builddeps-cache.outputs.cache-hit != 'true' }} | |
working-directory: /home/runner | |
run: | | |
set -euo pipefail | |
cd /home/runner | |
wget https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz \ | |
--output-document=$RUNNER_TEMP/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz | |
tar xJf $RUNNER_TEMP/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz | |
pwd && ls | |
- name: Checkout and build libopencm3 | |
if: ${{ steps.builddeps-cache.outputs.cache-hit != 'true' }} | |
working-directory: /home/runner | |
run: | | |
set -euo pipefail | |
cd /home/runner | |
test -d libopencm3 && rm -fr libopencm3 | |
export PATH=/home/runner/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin:${PATH} | |
git clone https://github.com/libopencm3/libopencm3.git -b v0.8.0 | |
cd libopencm3 | |
make | |
- name: "apt update" | |
run: sudo apt update | |
- name: "Install deps" | |
run: sudo apt install -y cmake gperf | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Build | |
shell: bash | |
working-directory: ./src/platforms/stm32/ | |
run: | | |
set -euo pipefail | |
export PATH=/home/runner/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin:${PATH} | |
mkdir build | |
cd build | |
# -DAVM_WARNINGS_ARE_ERRORS=ON | |
cmake .. -DCMAKE_TOOLCHAIN_FILE=cmake/arm-toolchain.cmake -DLIBOPENCM3_DIR=/home/runner/libopencm3 | |
make -j |