.github: Initial project build support #31
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
name: precision-converters-firmware | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
project: | ||
- ad4130_iio | ||
platform: | ||
- MBED_PLATFORM | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- name: Get file changes | ||
id: changed-files | ||
run: | | ||
Check failure on line 24 in .github/workflows/build_projects.yaml GitHub Actions / precision-converters-firmwareInvalid workflow file
|
||
echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT | ||
$changed_files = git diff --name-only HEAD^ HEAD | ||
echo "${{ changed_files }}" | ||
echo "${{ matrix.project }}" | ||
- name: Update submodules recursively | ||
if: contains(${{ matrix.project }}, ${{ steps.changed-files.outputs.changed_files }}) | ||
run: | | ||
git submodule update --init --recursive | ||
- name: Get pre-requisites | ||
if: contains(${{ matrix.project }}, ${{ steps.changed-files.outputs.changed_files }}) | ||
run: | | ||
set -x | ||
pip install mbed-cli | ||
wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 | ||
tar xjf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 | ||
export PATH="${PATH}:${PWD}/gcc-arm-none-eabi-10.3-2021.10/bin" | ||
mbed config -G GCC_ARM_PATH "${PWD}/gcc-arm-none-eabi-10.3-2021.10/bin" | ||
pushd libraries/no-OS/libraries/mbed/mbed-os | ||
pip install -r requirements.txt | ||
popd | ||
- name: Build projects | ||
if: contains(${{ matrix.project }}, ${{ steps.changed-files.outputs.changed_files }}) | ||
run: | | ||
pushd projects/${{ matrix.project }} | ||
make NEW_CFLAGS+=-DPLATFORM_NAME=${{ matrix.platform }} | ||
popd | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.project }} | ||
path: | | ||
projects/${{ matrix.project }}/build/${{ matrix.project }}.bin |