From 16e099a9f946661ad7924b95b1345d7e1bf9dc69 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 23 Apr 2024 12:38:55 +0700 Subject: [PATCH] integrate msp430 to build cmake --- .../{cmake_arm.yml => build_cmake.yml} | 74 +++++++++++++++---- .github/workflows/build_msp430.yml | 71 ------------------ 2 files changed, 59 insertions(+), 86 deletions(-) rename .github/workflows/{cmake_arm.yml => build_cmake.yml} (80%) delete mode 100644 .github/workflows/build_msp430.yml diff --git a/.github/workflows/cmake_arm.yml b/.github/workflows/build_cmake.yml similarity index 80% rename from .github/workflows/cmake_arm.yml rename to .github/workflows/build_cmake.yml index 8eb1e3f74..ee6d83992 100644 --- a/.github/workflows/cmake_arm.yml +++ b/.github/workflows/build_cmake.yml @@ -1,4 +1,4 @@ -name: CMake ARM +name: Build CMake on: workflow_dispatch: @@ -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: @@ -20,7 +20,7 @@ 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 }} @@ -156,6 +156,14 @@ jobs: - 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 @@ -173,19 +181,9 @@ jobs: wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.xz tar -C ~/cache/toolchain -xaf toolchain.tar.xz - - name: Set Toolchain Path - run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin` - - - 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: Get Dependencies + - 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 }} @@ -194,6 +192,52 @@ jobs: env: PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk + # --------------------------------------- + # Build ARM with Clang + # --------------------------------------- + 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@v3 + 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 diff --git a/.github/workflows/build_msp430.yml b/.github/workflows/build_msp430.yml deleted file mode 100644 index 95d212708..000000000 --- a/.github/workflows/build_msp430.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Build MSP430 - -on: - workflow_dispatch: - push: - paths: - - 'src/**' - - 'examples/**' - - 'lib/**' - - 'hw/**' - - 'tools/get_deps.py' - - '.github/workflows/build_msp430.yml' - pull_request: - branches: [ master ] - paths: - - 'src/**' - - 'examples/**' - - 'lib/**' - - 'hw/**' - - 'tools/get_deps.py' - - '.github/workflows/build_msp430.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - build-msp430: - 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@v3 - id: cache-toolchain - with: - path: ~/cache/ - key: ${{ runner.os }}-21-03-04-${{ 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: Set Toolchain Path - run: | - echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin` - sudo apt install -y ninja-build - - - name: Build - run: | - python3 tools/get_deps.py ${{ matrix.family }} - python tools/build_cmake.py ${{ matrix.family }} -DCMAKE_BUILD_TYPE=MinSizeRel