-
Notifications
You must be signed in to change notification settings - Fork 28
96 lines (78 loc) · 3.71 KB
/
build.yml
File metadata and controls
96 lines (78 loc) · 3.71 KB
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
# Ref: https://github.com/arduino/arduino-cli-example/blob/master/.github/workflows/test.yaml
name: build
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# Here we tell GitHub that the jobs must be determined
# dynamically depending on a matrix configuration.
strategy:
matrix:
# The matrix will produce one job for each configuration
# parameter of type `arduino-platform`, in this case a
# total of 2.
arduino-platform: ["esp8266:esp8266"]
# This is usually optional but we need to statically define the
# FQBN of the boards we want to test for each platform. In the
# future the CLI might automatically detect and download the core
# needed to compile against a certain FQBN, at that point the
# following `include` section will be useless.
include:
#- arduino-platform: "arduino:avr"
# fqbn: "arduino:avr:unowifi"
- arduino-platform: "esp8266:esp8266"
fqbn: "esp8266:esp8266:generic:xtal=160,baud=57600"
# The type of runner that the job will run on
runs-on: windows-latest
# Environment variables
env:
ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS: https://arduino.esp8266.com/stable/package_esp8266com_index.json
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
# First of all, we clone the repo using the `checkout` action.
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v2
#- uses: actions/setup-python@v1
# with:
# python-version: '3.x'
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
# We use the `arduino/setup-arduino-cli` action to install and
# configure the Arduino CLI on the system.
- name: Setup Arduino CLI
uses: arduino/setup-arduino-cli@v1
# We then install the platform, which one will be determined
# dynamically by the build matrix.
- name: Install platform
run: |
arduino-cli config init --additional-urls ${{ env.ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS}}
arduino-cli core update-index
arduino-cli core install ${{ matrix.arduino-platform }}
arduino-cli lib install "WiFiManager"
echo "Current workspace: ${{ github.workspace }}"
ls ${{ github.workspace }}
# Finally, we compile the sketch, using the FQBN that was set
# in the build matrix.
- name: Compile Sketch
run: arduino-cli compile --fqbn ${{ matrix.fqbn }} GoogleDocs
- run: echo "🍏 This job's status is ${{ job.status }}."
# Runs a single command using the runners shell
#- name: pre-install
# run: bash ./actions_install.sh
# Runs a set of commands using the runners shell
#- name: test
# run: |
# echo Add other actions to build,
# python3 build_platform.py uno leonardo mega2560 zero esp8266 esp32 pico_rp2040