Skip to content

Commit

Permalink
Merge pull request #2606 from hathach/build-clang
Browse files Browse the repository at this point in the history
Add  Clang support
  • Loading branch information
hathach authored Apr 24, 2024
2 parents 0fb73ea + 19f1080 commit 313d966
Show file tree
Hide file tree
Showing 252 changed files with 6,011 additions and 1,533 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz

- name: Cache Toolchain
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-toolchain
with:
path: ~/cache/
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
- 'lpc51'
- 'mm32 msp432e4'
- 'samd11 same5x saml2x'
- 'stm32f2 stm32f3'
- 'stm32l0 stm32wb'
- 'tm4c123 xmc4000'
steps:
Expand Down
147 changes: 135 additions & 12 deletions .github/workflows/cmake_arm.yml → .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CMake ARM
name: Build CMake

on:
workflow_dispatch:
Expand All @@ -10,7 +10,7 @@ on:
- 'hw/**'
- 'test/hil/**'
- 'tools/get_deps.py'
- '.github/workflows/cmake_arm.yml'
- '.github/workflows/build_cmake.yml'
pull_request:
branches: [ master ]
paths:
Expand All @@ -20,17 +20,17 @@ on:
- 'hw/**'
- 'test/hil/**'
- 'tools/get_deps.py'
- '.github/workflows/cmake_arm.yml'
- '.github/workflows/build_cmake.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
# ---------------------------------------
# Build ARM family
# Build ARM with GCC
# ---------------------------------------
build-arm:
arm-gcc:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -49,6 +49,8 @@ jobs:
- 'samd51'
- 'stm32f0'
- 'stm32f1'
- 'stm32f2'
- 'stm32f3'
- 'stm32f4'
- 'stm32f7'
- 'stm32g0'
Expand All @@ -66,10 +68,7 @@ jobs:
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '11.2-2022.02'

- name: Install Ninja
run: sudo apt install -y ninja-build
release: '12.3.Rel1'

- name: Checkout TinyUSB
uses: actions/checkout@v4
Expand All @@ -83,12 +82,13 @@ jobs:
path: pico-sdk

- name: Get Dependencies
run: python3 tools/get_deps.py ${{ matrix.family }}
run: |
sudo apt install -y ninja-build
python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python tools/build_cmake.py ${{ matrix.family }} -DCMAKE_BUILD_TYPE=MinSizeRel
env:
# for rp2040, there is no harm if defined for other families
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk

- name: Upload Artifacts for Hardware Testing (rp2040)
Expand All @@ -115,14 +115,137 @@ jobs:
path: |
cmake-build/cmake-build-itsybitsy_m4/*/*/*.bin
# ---------------------------------------
# Build ARM with Clang
# ---------------------------------------
arm-clang:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
family:
# Alphabetical order
- 'imxrt'
- 'kinetis_k kinetis_kl'
- 'lpc17 lpc18 lpc40 lpc43'
- 'lpc54 lpc55'
#- 'mcx' not working with gcc anymore, need to fix this first
- 'nrf'
#- 'ra' port later
#- 'rp2040' port later
- 'samd21'
- 'samd51'
- 'stm32f0'
- 'stm32f1'
- 'stm32f2'
- 'stm32f3'
- 'stm32f4'
- 'stm32f7'
- 'stm32g0'
- 'stm32g4'
- 'stm32h5'
- 'stm32h7'
- 'stm32l4'
- 'stm32u5'
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Checkout TinyUSB
uses: actions/checkout@v4

- name: Checkout pico-sdk for rp2040
if: matrix.family == 'rp2040'
uses: actions/checkout@v4
with:
repository: raspberrypi/pico-sdk
ref: develop
path: pico-sdk

- name: Set Toolchain URL
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-17.0.1/LLVMEmbeddedToolchainForArm-17.0.1-Linux-x86_64.tar.xz

- name: Cache Toolchain
uses: actions/cache@v4
id: cache-toolchain
with:
path: ~/cache/
key: ${{ runner.os }}-24-04-17-${{ env.TOOLCHAIN_URL }}

- name: Install Toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: |
mkdir -p ~/cache/toolchain
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.xz
tar -C ~/cache/toolchain -xaf toolchain.tar.xz
- name: Prepare to build
run: |
echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
sudo apt install -y ninja-build
python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=clang -DCMAKE_BUILD_TYPE=MinSizeRel
env:
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk

# ---------------------------------------
# Build MSP430 with GCC
# ---------------------------------------
msp430-gcc:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
family:
# Alphabetical order
- 'msp430'
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Checkout TinyUSB
uses: actions/checkout@v4

- name: Set Toolchain URL
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2

- name: Cache Toolchain
uses: actions/cache@v4
id: cache-toolchain
with:
path: ~/cache/
key: ${{ runner.os }}-24-04-17-${{ env.TOOLCHAIN_URL }}

- name: Install Toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: |
mkdir -p ~/cache/toolchain
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.bz2
tar -C ~/cache/toolchain -xaf toolchain.tar.bz2
- name: Prepare to build
run: |
echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
sudo apt install -y ninja-build
python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python tools/build_cmake.py ${{ matrix.family }} -DCMAKE_BUILD_TYPE=MinSizeRel

# ---------------------------------------
# Hardware in the loop (HIL)
# Current self-hosted instance is running on an RPI4. For attached hardware checkout hil_pi4.json
# ---------------------------------------
hil-test:
# run only with hathach's commit due to limited resource on RPI4
if: github.repository_owner == 'hathach'
needs: build-arm
needs: arm-gcc
runs-on: [self-hosted, rp2040, nrf52840, hardware-in-the-loop]
strategy:
fail-fast: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_esp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# ESP32-S2
- 'espressif_kaluga_1'
# ESP32-S3
- 'espressif_s3_devkitc'
- 'espressif_s3_devkitm'
steps:
- name: Setup Python
uses: actions/setup-python@v5
Expand All @@ -51,7 +51,7 @@ jobs:
run: docker run --rm -v $PWD:/project -w /project espressif/idf:v5.1.1 python3 tools/build_esp32.py ${{ matrix.board }}

- name: Upload Artifacts for Hardware Testing
if: matrix.board == 'espressif_s3_devkitc' && github.repository_owner == 'hathach'
if: matrix.board == 'espressif_s3_devkitm' && github.repository_owner == 'hathach'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.board }}
Expand All @@ -75,7 +75,7 @@ jobs:
fail-fast: false
matrix:
board:
- 'espressif_s3_devkitc'
- 'espressif_s3_devkitm'
steps:
- name: Clean workspace
run: |
Expand Down
71 changes: 0 additions & 71 deletions .github/workflows/build_msp430.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build_renesas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run

- name: Cache Toolchain
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-toolchain
with:
path: ~/cache/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_riscv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.1.0-1.1/xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz

- name: Cache Toolchain
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-toolchain
with:
path: ~/cache/
Expand Down
Loading

0 comments on commit 313d966

Please sign in to comment.