aboutsummaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/ci.yml
blob: bdda3e017ef10dc16249b23a36271f7f431a375c (plain)
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
name: CI

on:
  push:

  pull_request:

env:
  ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL: false

jobs:
  ci:
    name: ${{ matrix.hwVersion }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        hwVersion: [HW5, HW4, HW3, HW2, HW1]

    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 ${{ matrix.hwVersion }}/#define ${{ matrix.hwVersion }}/g' Config.h
          arduino-cli compile --fqbn arduino:avr:mega --warnings all --build-property compiler.cpp.extra_flags="-DGITHUB_CI"