2021-08-20 00:10:42 -07:00
|
|
|
name: Build Firmware
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-11-03 18:03:15 -07:00
|
|
|
- uses: actions/checkout@v3
|
2021-08-20 00:10:42 -07:00
|
|
|
- name: Cache pip
|
2022-11-13 15:46:19 -08:00
|
|
|
uses: actions/cache@v3
|
2021-08-20 00:10:42 -07:00
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Cache PlatformIO
|
2022-11-13 15:46:19 -08:00
|
|
|
uses: actions/cache@v3
|
2021-08-20 00:10:42 -07:00
|
|
|
with:
|
|
|
|
path: ~/.platformio
|
|
|
|
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
|
|
|
|
|
|
|
- name: Set up Python
|
2022-10-18 16:42:56 -07:00
|
|
|
uses: actions/setup-python@v4
|
2021-08-20 00:10:42 -07:00
|
|
|
|
|
|
|
- name: Install PlatformIO
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install --upgrade platformio
|
|
|
|
|
2022-06-29 00:11:42 -07:00
|
|
|
- name: Build test atmel
|
|
|
|
run: platformio run -e megaatmega2560 -e megaatmega2561
|
|
|
|
|
|
|
|
- name: Build test teensy
|
|
|
|
run: platformio run -e teensy35 -e teensy36 -e teensy41
|
|
|
|
|
|
|
|
- name: Build test STM32
|
|
|
|
run: platformio run -e black_F407VE -e BlackPill_F401CC -e BlackPill_F411CE_USB
|
2021-08-20 01:55:49 -07:00
|
|
|
|
|
|
|
- name: Upload to Speeduino server
|
2022-06-29 00:11:42 -07:00
|
|
|
if: github.event_name != 'pull_request' && github.repository_owner == 'noisymime'
|
2021-08-20 01:55:49 -07:00
|
|
|
env:
|
|
|
|
WEB_PWD: ${{ secrets.WEB_PWD }}
|
|
|
|
run: |
|
|
|
|
curl -v https://speeduino.com:2078 || true
|
|
|
|
curl -v --tlsv1.2 --ipv4 --user "speeduino_firmware@speeduino.com:$WEB_PWD" --basic -T "./.pio/build/megaatmega2560/firmware.hex" "https://speeduino.com:2078/bin/master.hex"
|
|
|
|
curl -v --tlsv1.2 --ipv4 --user "speeduino_firmware@speeduino.com:$WEB_PWD" --basic -T "./.pio/build/teensy35/firmware.hex" "https://speeduino.com:2078/teensy35/master-teensy35.hex"
|
|
|
|
curl -v --tlsv1.2 --ipv4 --user "speeduino_firmware@speeduino.com:$WEB_PWD" --basic -T "./.pio/build/teensy36/firmware.hex" "https://speeduino.com:2078/teensy36/master-teensy36.hex"
|
|
|
|
curl -v --tlsv1.2 --ipv4 --user "speeduino_firmware@speeduino.com:$WEB_PWD" --basic -T "./.pio/build/teensy41/firmware.hex" "https://speeduino.com:2078/teensy41/master-teensy41.hex"
|
|
|
|
curl --tlsv1.2 --ipv4 --user "speeduino_firmware@speeduino.com:$WEB_PWD" --basic -T "./reference/speeduino.ini" "https://speeduino.com:2078/master.ini"
|
2023-04-23 23:29:24 -07:00
|
|
|
|
|
|
|
- name: Discord Notification (Build Failed)
|
|
|
|
uses: rjstone/discord-webhook-notify@v1
|
2022-06-29 00:11:42 -07:00
|
|
|
if: failure() && github.event_name != 'pull_request' && github.repository_owner == 'noisymime'
|
2023-04-23 23:29:24 -07:00
|
|
|
with:
|
|
|
|
severity: error
|
|
|
|
avatarUrl: https://avatars.githubusercontent.com/u/9919?v=4&size=48
|
|
|
|
username: GitHub
|
|
|
|
description: 'Firmware build FAILED :warning:'
|
2023-04-30 02:57:58 -07:00
|
|
|
details: "**Author:** ${{ github.event.pusher.name }} \n
|
|
|
|
**Commit URL:** ${{ github.event.head_commit.url }} \n
|
|
|
|
**Commit Message:** ${{ github.event.head_commit.message }}"
|
2023-04-23 23:29:24 -07:00
|
|
|
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|