mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-23 21:19:16 +01:00
Merge pull request #507 from niklasweber/add_github_workflow
Add github actions workflow to build code for each HW rev. on each push
This commit is contained in:
commit
15966b79c8
48
.github/workflows/build.yml
vendored
Normal file
48
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
hwVersion:
|
||||
description: "The version of the hardware to compile for (e.g. HW5, HW4, ...)"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Arduino CLI
|
||||
uses: arduino/setup-arduino-cli@v1
|
||||
|
||||
- name: Install platform
|
||||
run: |
|
||||
arduino-cli core update-index
|
||||
arduino-cli core install arduino:avr
|
||||
|
||||
- name: Install libraries
|
||||
run: |
|
||||
arduino-cli lib install \
|
||||
"SdFat" \
|
||||
"Adafruit SSD1306" \
|
||||
"Adafruit GFX Library" \
|
||||
"Adafruit BusIO" \
|
||||
"U8g2" \
|
||||
"Adafruit NeoPixel" \
|
||||
"RotaryEncoder" \
|
||||
"Etherkit Si5351" \
|
||||
"RTClib" \
|
||||
"FreqCount"
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Compile
|
||||
run: |
|
||||
cd Cart_Reader/
|
||||
# Select hardware version by uncommenting it (using regular expression)
|
||||
sed -i 's/^\/\/[\t ]*#define ${{ inputs.hwVersion }}/#define ${{ inputs.hwVersion }}/g' Cart_Reader.ino
|
||||
arduino-cli compile --fqbn arduino:avr:mega
|
29
.github/workflows/ci.yml
vendored
Normal file
29
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
name: CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
HW5:
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
hwVersion: "HW5"
|
||||
|
||||
HW4:
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
hwVersion: "HW4"
|
||||
|
||||
HW3:
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
hwVersion: "HW3"
|
||||
|
||||
HW2:
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
hwVersion: "HW2"
|
||||
|
||||
HW1:
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
hwVersion: "HW1"
|
Loading…
Reference in New Issue
Block a user