Labdos01 conditional build (#14), extended build #272
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: Build firmware | |
on: | |
# Triggers the workflow on push or pull request events but only for the "SPACEDOS03A" branch | |
push: | |
#branches: [ "LABDOS01A" ] | |
paths: | |
- 'fw/**' | |
- '*/*.yml' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- name: LABDOS_512 | |
type: LABDOS | |
channels: 512 | |
fqbn: clock=8MHz_external | |
- name: LABDOS_1024 | |
type: LABDOS | |
channels: 1024 | |
fqbn: clock=8MHz_external | |
- name: LABDOS_512_16Mhz | |
type: LABDOS | |
fqbn: clock=16MHz_external | |
channels: 512 | |
- name: LABDOS_1024_16Mhz | |
type: LABDOS | |
fqbn: clock=16MHz_external | |
channels: 1024 | |
- name: LABDOS512 | |
type: LABDOS512 | |
fqbn: clock=8MHz_external | |
channels: 0 | |
- name: LABDOS512_SD | |
type: LABDOS512_SD | |
fqbn: clock=8MHz_external | |
channels: 0 | |
- name: UAVDOS | |
type: UAVDOS | |
fqbn: clock=8MHz_external | |
channels: 0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
continue-on-error: true | |
with: | |
submodules: True | |
- name: Update git hash | |
run: | | |
echo "// This file is overwritten by github actions, do not update it manually" > fw/githash.h | |
echo "String githash = \"${{ github.sha }},CI_action\";" >> fw/githash.h | |
- name: Compile all examples | |
uses: ArminJo/arduino-test-compile@v3 | |
with: | |
arduino-board-fqbn: MightyCore:avr:1284:BOD=disabled,LTO=Os,${{ matrix.fqbn }},variant=modelP --build-property compiler.cpp.extra_flags="-DCHANNELS=${{ matrix.channels }}" | |
platform-url: https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json | |
sketch-names-find-start: fw/${{ matrix.type }} | |
set-build-path: true | |
#build-properties: compiler.cpp.extra_flags="-DCHANNELS=${{ matrix.channels }}" | |
# build-properties: "build.extra_flags=\"-DCHANNELS=100\"" .. tohle z nejakeho duvodu nefunguje, ackoliv by to mela byt spravna cesta | |
#- name: Move to right place | |
# # run: | | |
# mkdir fw/${{ matrix.type }}/build_${{ matrix.name }} | |
# mv fw/${{ matrix.type }}/build/* fw/${{ matrix.type }}/build_${{ matrix.name }}/ | |
- name: Store data | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fw_${{ matrix.type }}_${{ matrix.name }} | |
path: fw/${{ matrix.type }}/build/*.hex | |
retention-days: 1 | |
commit: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
continue-on-error: true | |
with: | |
submodules: True | |
- name: Update git hash | |
run: | | |
echo "// This file is overwritten by github actions, do not update it manually" > fw/githash.h | |
echo "String githash = \"${{ github.sha }},user_build\";" >> fw/githash.h | |
- run: | | |
rm fw/build -r || true | |
mkdir fw/build | |
- name: Download a Build Artifact | |
uses: actions/[email protected] | |
with: | |
path: 'fw/build/' | |
- name: Get last commit message | |
id: last-commit-message | |
run: | | |
echo "msg=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: ${{ steps.last-commit-message.outputs.msg }}, extended build | |
file_pattern: 'fw/build/* fw/githash.h' | |
#commit_options: '--amend --no-edit' | |
#push_options: '--force' | |
skip_fetch: true |