forked from lincomatic/open_evse
-
Notifications
You must be signed in to change notification settings - Fork 78
78 lines (63 loc) · 2.58 KB
/
build_arduino.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
name: Build using Arduino
on:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: openevse_arduino_1-6-15
arduino-platform: "arduino:avr"
version: 1.6.15
fqbn: "arduino:avr:openevse"
- name: openevse_arduino_1-6-23
arduino-platform: "arduino:avr"
version: 1.6.23
fqbn: "arduino:avr:openevse"
- name: openevse_arduino_1-8-3
arduino-platform: "arduino:avr"
version: 1.8.3
fqbn: "arduino:avr:openevse"
steps:
- name: Cache Arduino
uses: actions/cache@v2
with:
path: ~/.arduino15
key: ${{ runner.os }}-${{ matrix.name }}-arduino-15-${{ hashFiles('**/packages.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.name }}-arduino-15-
- uses: actions/checkout@v2
- name: Setup Arduino CLI
uses: arduino/setup-arduino-cli@v1
- name: Install platform
run: |
arduino-cli core update-index
arduino-cli core install ${{ matrix.arduino-platform }}@${{ matrix.version }}
- name: Copy support files
run: |
cp arduino/1.6.15/boards.local.txt ~/.arduino15/packages/arduino/hardware/avr/${{ matrix.version }}/
cp arduino/1.6.15/programmers.txt ~/.arduino15/packages/arduino/hardware/avr/${{ matrix.version }}/
- name: Compile Sketch
run: arduino-cli compile --fqbn ${{ matrix.fqbn }} --export-binaries --verbose firmware/open_evse
- name: Get compiler and output info
run: |
NAME=${{ matrix.name }}
BUILT_TOOL=Arduino
ARDUINO_DIR=~/.arduino15/packages/arduino
AVR_CORE_VERSION=${{ matrix.version }}
AVR_CORE_DIR=$ARDUINO_DIR/hardware/avr/$AVR_CORE_VERSION
# EVIL, should use `jq`
GCC_PACKAGE=$(grep "\"avr\"" ~/.arduino15/package_index.json -A 100 | grep "\"$AVR_CORE_VERSION\"" -A 100 | grep "\"avr-gcc\"" -A 1 | grep "\"version\"" | head -n 1 | cut -d \" -f4)
TOOLCHAIN=$ARDUINO_DIR/tools/avr-gcc/$GCC_PACKAGE
ELF=firmware/open_evse/build/arduino.avr.openevse/open_evse.ino.elf
HEX=firmware/open_evse/build/arduino.avr.openevse/open_evse.ino.hex
source ci/info_common.sh info.json
- name: Upload output to GitHub
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.name }}
path: |
firmware/open_evse/build/arduino.avr.openevse/open_evse.ino.hex
info.json