Skip to content

Commit

Permalink
Implemented CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
rmonier committed Aug 12, 2022
1 parent f1dcbee commit 3b6a2fd
Show file tree
Hide file tree
Showing 9 changed files with 2,955 additions and 26 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build Firmware

on:
release:
types: [released, prereleased]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up caching
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Install Doxygen
run: sudo apt-get install -y doxygen

- name: Build Doxygen documentation
run: |
mkdir -p build/docs
wget https://user-images.githubusercontent.com/26198903/184120070-8a05ab1c-6abf-40b0-a7cc-3ee57c1b2bb5.png -O build/docs/logo.png
doxygen
- name: Zip Doxygen documentation
run: cd build/docs && zip -r documentation.zip html

- name: Upload Doxygen documentation
uses: softprops/action-gh-release@v1
with:
files: build/docs/documentation.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build PlatformIO Project
run: pio run -e release

- name: Upload Release Firmware
uses: softprops/action-gh-release@v1
with:
files: .pio/build/release/firmware.bin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


# - if: failure()
# name: Delete release
# run: |
# curl -s -X DELETE \
# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# https://api.github.com/repos/${{ github.event.repository.full_name }}/releases/${{ github.event.release.id }}
# curl -s -X DELETE \
# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# https://api.github.com/repos/${{ github.event.repository.full_name }}/git/refs/tags/${{ github.event.release.tag_name }}
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test with Unity

on:
push:
branches: [ master ]

workflow_dispatch:

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up caching
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Run the desktop tests with Unity
run: pio test -e native_debug -e native_release

# Not yet implemented (will have to use a simulator in CI, see: https://docs.platformio.org/en/latest/advanced/unit-testing/simulators/qemu.html)
#- name: Run the board tests with Unity
# run: pio test -e debug -e release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.pio
build/
Loading

0 comments on commit 3b6a2fd

Please sign in to comment.