-
-
Notifications
You must be signed in to change notification settings - Fork 31
153 lines (126 loc) · 4.55 KB
/
build.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
150
151
152
153
name: Build
env:
SKETCH_NAME: "*.ino"
PROJECT_NAME: ESP32-BLECollector
on:
push:
paths:
- '**.ino'
- '**.cpp'
- '**.hpp'
- '**.h'
- '**.c'
- '**build.yml'
pull_request:
release:
types: [published]
workflow_dispatch:
inputs:
# logLevel:
# description: 'Log level'
# required: true
# default: 'warning'
tag_name:
description: 'Target tag'
jobs:
matrix_build:
name: ${{ matrix.fancy-name }}
runs-on: ubuntu-latest
strategy:
matrix:
arduino-boards-fqbn:
- esp32:esp32:m5stack-core-esp32:PartitionScheme=min_spiffs
- esp32:esp32:m5stack-fire
- esp32:esp32:m5stack-core2
- esp32:esp32:odroid_esp32:PartitionScheme=min_spiffs
- esp32:esp32:esp32s3box
platform-url:
- https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
required-libraries:
- ESP32-Chimera-Core,Time,LovyanGFX,M5Stack-SD-Updater,Sqlite3Esp32,TinyGPSPlus,NimBLE-Arduino
include:
- arduino-boards-fqbn: esp32:esp32:m5stack-core-esp32:PartitionScheme=min_spiffs
fancy-name: M5Stack
bin-name: M5stack-BLECollector.bin
- arduino-boards-fqbn: esp32:esp32:m5stack-core2
fancy-name: M5Core2
bin-name: M5Core2-BLECollector.bin
- arduino-boards-fqbn: esp32:esp32:m5stack-fire
fancy-name: M5Fire
bin-name: M5Fire-BLECollector.bin
- arduino-boards-fqbn: esp32:esp32:odroid_esp32:PartitionScheme=min_spiffs
fancy-name: OdroidGo
bin-name: OdroidGo-BLECollector.bin
- arduino-boards-fqbn: esp32:esp32:esp32s3box
fancy-name: S3Box
bin-name: S3Box-BLECollector.bin
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Compile example
uses: ArminJo/arduino-test-compile@v3
with:
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
platform-url: ${{ matrix.platform-url }}
required-libraries: ${{ matrix.required-libraries }}
build-properties: ${{ toJson(matrix.build-properties) }}
sketch-names: ${{ env.SKETCH_NAME }}
set-build-path: true
extra-arduino-cli-args: --warnings none
- name: Copy compiled binary
#if: startsWith(github.ref, 'refs/tags/')
run: |
binFile=`find . | grep 'ESP32-BLECollector.ino.bin' | head -1`
binPath=`dirname $binFile`
echo "binPath: $binPath"
echo "binFile: $binFile"
echo "binName: ${{ matrix.bin-name }}"
ls $binPath
mkdir -p /home/runner/builds
cp "$binFile" "/home/runner/builds/${{ matrix.bin-name }}"
- name: Upload artifact ${{ matrix.bin-name }}
uses: actions/upload-artifact@v3
#if: startsWith(github.ref, 'refs/tags/')
with:
name: ${{ matrix.bin-name }}
path: /home/runner/builds/${{ matrix.bin-name }}
post_build:
name: Gather Artefacts
runs-on: ubuntu-latest
# wait until matrix jobs are all finished
needs: matrix_build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create artifacts dir
#if: startsWith(github.ref, 'refs/tags/')
run: mkdir -p /home/runner/builds
- name: Download artifacts
uses: actions/[email protected]
#if: startsWith(github.ref, 'refs/tags/')
with:
path: /home/runner/builds
- name: Dispatch check
uses: softprops/action-gh-release@v1
if: github.event.inputs.tag_name != ''
with:
tag_name: ${{ github.event.inputs.tag_name }}
files: |
/home/runner/builds/M5stack-BLECollector.bin/*
/home/runner/builds/M5Core2-BLECollector.bin/*
/home/runner/builds/M5Fire-BLECollector.bin/*
/home/runner/builds/OdroidGo-BLECollector.bin/*
/home/runner/builds/S3Box-BLECollector.bin/*
- name: Release check
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
/home/runner/builds/M5stack-BLECollector.bin
/home/runner/builds/M5Core2-BLECollector.bin
/home/runner/builds/M5Fire-BLECollector.bin
/home/runner/builds/OdroidGo-BLECollector.bin
/home/runner/builds/S3Box-BLECollector.bin