-
Notifications
You must be signed in to change notification settings - Fork 1
149 lines (131 loc) · 4.85 KB
/
build_fw.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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/download-artifact@v3.0.2
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/get-release@v1.3.2
# env:
# GITHUB_TOKEN: ${{ github.token }}
#
# - run: |
# mkdir build
#
# - name: Download a Build Artifact
# uses: actions/download-artifact@v3.0.2
# 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