Skip to content

Update Firmware Doc

Update Firmware Doc #5

Workflow file for this run

# ------------------------------------------------------------------------------
# USB EPROM/Flash Programmer
#
# Copyright (2022) Robson Martins
#
# This work is licensed under a Creative Commons Attribution-NonCommercial-
# ShareAlike 4.0 International License.
# ------------------------------------------------------------------------------
name: Update Firmware Doc
on:
workflow_dispatch:
env:
BUILD_TYPE: Debug
FIRMWARE_PROJECT_DIR: ${{github.workspace}}/firmware/usbflashprog
jobs:
build:
name: Update Firmware Doc
runs-on: ubuntu-latest
steps:
# ------------------------------------------------------------------------
# Checkout the sources
# ------------------------------------------------------------------------
- name: Checkout the Sources
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
# ------------------------------------------------------------------------
# Install Prerequisites (Linux)
# ------------------------------------------------------------------------
- name: Install Prerequisites
run: |
sudo apt-get update
sudo apt-get install lcov doxygen graphviz
# ------------------------------------------------------------------------
# Configure CMake
# ------------------------------------------------------------------------
- name: Configure CMake
working-directory: ${{env.FIRMWARE_PROJECT_DIR}}
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTEST_BUILD=ON
# ------------------------------------------------------------------------
# Build
# ------------------------------------------------------------------------
- name: Build
working-directory: ${{env.FIRMWARE_PROJECT_DIR}}
run: cmake --build build --config ${{env.BUILD_TYPE}}
# ------------------------------------------------------------------------
# Test
# ------------------------------------------------------------------------
- name: Test
working-directory: ${{env.FIRMWARE_PROJECT_DIR}}/build
run: ctest -C ${{env.BUILD_TYPE}}
# ------------------------------------------------------------------------
# Coverage
# ------------------------------------------------------------------------
- name: Coverage
working-directory: ${{env.FIRMWARE_PROJECT_DIR}}
run: |
rm -Rf ${{env.FIRMWARE_PROJECT_DIR}}/../../docs/firmware/lcov/
lcov --directory ${{env.FIRMWARE_PROJECT_DIR}}/build/ --capture --output-file ${{env.FIRMWARE_PROJECT_DIR}}/build/coverage.info -rc lcov_branch_coverage=1 --exclude \/usr\/include\/\* --exclude \/usr\/local\/include\/\* --exclude ${{env.FIRMWARE_PROJECT_DIR}}\/build\/\* --exclude ${{env.FIRMWARE_PROJECT_DIR}}\/test\/\* --exclude ${{env.FIRMWARE_PROJECT_DIR}}\/\*\.h\*
genhtml --prefix ${{env.FIRMWARE_PROJECT_DIR}} --ignore-errors source ${{env.FIRMWARE_PROJECT_DIR}}/build/coverage.info --legend --title \"`git rev-parse --short HEAD`\" --output-directory ${{env.FIRMWARE_PROJECT_DIR}}/../../docs/firmware/lcov/
# ------------------------------------------------------------------------
# Doxygen
# ------------------------------------------------------------------------
- name: Doxygen
working-directory: ${{env.FIRMWARE_PROJECT_DIR}}
run: |
rm -Rf ${{env.FIRMWARE_PROJECT_DIR}}/../../docs/firmware/html/
doxygen
# ------------------------------------------------------------------------
# Commit
# ------------------------------------------------------------------------
- name: Commit Files
run: |
git config --local user.email "noreply-github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add docs/firmware/
git commit -m "Update Firmware Documentation" -a
# ------------------------------------------------------------------------
# Push
# ------------------------------------------------------------------------
- name: Push Changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}