ehm #271
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: | ||
workflow_call: | ||
secrets: inherit | ||
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: 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 | ||
run: | | ||
sudo snap install arduino-cli | ||
arduino-cli core update-index --additional-urls https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json,https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json > /dev/null | ||
arduino-cli core install MightyCore:avr --additional-urls https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json,https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json > /dev/null | ||
PLATFORM=MightyCore:avr | ||
arduino-cli compile --verbose --warnings all --fqbn MightyCore:avr:1284:BOD=disabled,LTO=Os,${{ matrix.fqbn }},variant=modelP --build-property compiler.cpp.extra_flags="-DCHANNELS=${{ matrix.channels }} -DBUILD=${{ github.build_number }}" --build-path fw/LABDOS/build/ fw/LABDOS | ||
- 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: | ||
if: github.event_name != 'release' #&& github.event.action == 'created' | ||
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 | ||
# release-job: | ||
# name: Releasing | ||
# needs: [build] | ||
# runs-on: ubuntu-latest | ||
# if: github.event_name == 'release' #&& github.event.action == 'created' | ||
# steps: | ||
# - name: Get release | ||
# id: get_release | ||
# uses: bruceadams/[email protected] | ||
# env: | ||
# GITHUB_TOKEN: ${{ github.token }} | ||
# | ||
# - run: | | ||
# mkdir build | ||
# | ||
# - name: Download a Build Artifact | ||
# uses: actions/[email protected] | ||
# with: | ||
# path: 'build/' | ||
# | ||
# - run: | | ||
# cd build; | ||
# find -type f -exec bash -c 'mv $0 $(echo $0|sed "s/\//_/2"|sed 's/\./${{github.build_number}}./g')' {} \; | ||
# cd ..; | ||
# | ||
# - name: Upload Release Asset | ||
# id: upload-release-asset | ||
# uses: NBTX/upload-release-assets@v1 | ||
# with: | ||
# upload_url: ${{ steps.get_release.outputs.upload_url }} | ||
# targets: build/**/*.hex | ||
# - name: Upload Release Assets | ||
# id: upload-release-assets | ||
# uses: dwenegar/upload-release-assets@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# release_id: ${{ steps.get_release.outputs.id }} | ||
# assets_path: build/*.hex |