replace FatFS with petit FatFS (#3) #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
# build in a matrix and upload binary artifacts | |
# - all environments | |
# - all profiles | |
# - all boards | |
build: | |
runs-on: ubuntu-latest | |
# build all environments in a matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
environment: [ "HC32F460" ] | |
profile: [ "FULL", "TINY", "SMALL" ] | |
board: [ "VOXELAB_V101" ] | |
steps: | |
# checkout the repository | |
- uses: actions/checkout@v4 | |
# enable caching of pip and platformio | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/pip | |
~/.platformio/.cache | |
key: ${{ runner.os }}-pio | |
# install python | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
# install platformio | |
- name: Install PlatformIO core | |
run: pip install --upgrade platformio | |
# print the build environment name | |
- name: Print matrix configuration | |
run: echo "environment = ${{ matrix.environment }}; profile = ${{ matrix.profile }}; board = ${{ matrix.board }}" | |
# build the environment with the given profile and board | |
- name: Build environment | |
run: export PLATFORMIO_BUILD_FLAGS="-DCONFIG_PROFILE=CONFIG_PROFILE_${{ matrix.profile }} -DBOARD=BOARD_${{ matrix.board }}" ; pio run --environment ${{ matrix.environment }} | |
# upload the firmware binary only when building on the main branch | |
- name: Upload firmware binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: OpenHC32Boot-${{ matrix.environment }}-${{ matrix.board }}-${{ matrix.profile }} | |
path: .pio/build/${{ matrix.environment }}/firmware.bin | |
if: github.ref == 'refs/heads/main' | |
# dummy job after all environments were build | |
all_build: | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: always() | |
steps: | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} | |
# check all environments in one go | |
check: | |
runs-on: ubuntu-latest | |
# only run checks if all builds succeeded | |
# no sense in checking for potentially small defects | |
# if the project doesn't even build | |
needs: [all_build] | |
steps: | |
# checkout the repository | |
- uses: actions/checkout@v4 | |
# enable caching of pip and platformio | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/pip | |
~/.platformio/.cache | |
key: ${{ runner.os }}-pio | |
# install python | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
# install platformio | |
- name: Install PlatformIO core | |
run: pip install --upgrade platformio | |
# print the build environment name | |
- name: Print matrix value for 'environment' | |
run: echo ${{ matrix.environment }} | |
# check all environments in one go | |
# fail even on low defects - all defects should be fixed or at least acknowledged | |
- name: Check all environments | |
run: pio check --fail-on-defect=low |