diff options
author | Niklas Weber <[email protected]> | 2022-09-24 21:42:20 +0200 |
---|---|---|
committer | Niklas Weber <[email protected]> | 2022-09-24 21:42:20 +0200 |
commit | 95858bdda370c38c676f47ac4e235fce399fced5 (patch) | |
tree | f2e4b53f238d6e3f062227d790e26b3323a2e784 | |
parent | 0740ba9cefc4a3db5ef0569c0dea5917933378db (diff) | |
download | cartreader-95858bdda370c38c676f47ac4e235fce399fced5.tar.gz cartreader-95858bdda370c38c676f47ac4e235fce399fced5.zip |
Use a matrix instead of defining each job manually
-rw-r--r-- | .github/workflows/build.yml | 48 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 71 |
2 files changed, 46 insertions, 73 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index db0b1de..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,48 +0,0 @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31add87..cb46d1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,29 +1,50 @@ name: CI -on: [push] +on: + push: + + pull_request: + +env: + ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL: false 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" + 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' Cart_Reader.ino + arduino-cli compile --fqbn arduino:avr:mega |