speeduino/.github/workflows/unit-tests.yml

71 lines
2.1 KiB
YAML
Raw Normal View History

2021-08-20 05:52:10 -07:00
name: Unit Tests
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
# Only try to run hardware unit tests on the upstream repository
if: github.repository_owner == 'noisymime'
2021-08-20 05:52:10 -07:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2021-08-20 05:52:10 -07:00
- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: latest
platform: x32
2021-08-20 05:52:10 -07:00
- name: Set up Python
uses: actions/setup-python@v4
2021-08-20 06:40:23 -07:00
with:
python-version: '3.7'
2021-08-20 05:52:10 -07:00
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
2021-08-20 06:13:50 -07:00
pip install wheel
2021-08-20 06:01:53 -07:00
platformio update
platformio platform update
2021-08-20 05:52:10 -07:00
- name: Run Unit Tests
env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
2021-08-20 06:01:53 -07:00
run: |
platformio run -e megaatmega2560
platformio remote test --force-remote --environment megaatmega2560
- name: Slack Notification (Passed)
uses: rtCamp/action-slack-notify@v2
if: success()
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: 'Unit tests 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()
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: 'Unit tests FAILED :warning:'
SLACK_USERNAME: Github
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: actions url,commit