speeduino/.github/workflows/build-firmware.yml

81 lines
3.3 KiB
YAML

name: Build Firmware
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v4
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- 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
- name: Upload to Speeduino server
if: github.event_name != 'pull_request' && github.repository_owner == 'noisymime'
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"
- name: Slack Notification (Passed)
uses: rtCamp/action-slack-notify@v2
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'noisymime'
env:
SLACK_CHANNEL: git
SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
SLACK_ICON: https://avatars.githubusercontent.com/u/9919?v=4&size=48
SLACK_TITLE: 'Firmware build was successful :white_check_mark:'
SLACK_USERNAME: Github
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: actions url,commit
- name: Slack Notification (Failed)
uses: rtCamp/action-slack-notify@v2
if: failure() && github.event_name != 'pull_request' && github.repository_owner == 'noisymime'
env:
SLACK_CHANNEL: git
SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
SLACK_ICON: https://avatars.githubusercontent.com/u/9919?v=4&size=48
SLACK_TITLE: 'Firmware build FAILED :warning:'
SLACK_USERNAME: Github
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: actions url,commit