-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add workflow file for GitHub Actions
- Loading branch information
1 parent
4576cf3
commit e4390d3
Showing
1 changed file
with
114 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
--- | ||
name: CI Pipeline | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check_format: | ||
runs-on: ubuntu-latest | ||
container: docker.io/akospasztor/docker-gcc-arm:10-2020-q4-linux-2.2.0 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Check source code formatting | ||
run: > | ||
cmake --preset Debug | ||
&& cmake --build --preset Debug --target check-format | ||
check_style: | ||
runs-on: ubuntu-latest | ||
container: docker.io/akospasztor/docker-gcc-arm:10-2020-q4-linux-2.2.0 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Install requirements | ||
run: pip install -r requirements.txt | ||
- name: Run editorconfig-checker | ||
run: ec --exclude .git | ||
- name: Run flake8 | ||
run: flake8 | ||
- name: Run yamllint | ||
run: yamllint --strict . | ||
build_doxygen: | ||
runs-on: ubuntu-latest | ||
container: docker.io/akospasztor/docker-gcc-arm:10-2020-q4-linux-2.2.0 | ||
needs: [check_format, check_style] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Build doxygen documentation | ||
run: > | ||
cmake --preset Debug | ||
&& cmake --build --preset Debug --target doxygen | ||
- name: Upload doxygen html artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: doxygen-html | ||
path: build/doxygen/html | ||
build_firmware: | ||
runs-on: ubuntu-latest | ||
container: docker.io/akospasztor/docker-gcc-arm:10-2020-q4-linux-2.2.0 | ||
needs: [check_format, check_style] | ||
strategy: | ||
matrix: | ||
cmake_preset: ["Debug", "Release", "MinSizeRel", "RelWithDebInfo"] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Configure cmake preset | ||
run: cmake --preset ${{ matrix.cmake_preset }} | ||
- name: Build cmake preset | ||
run: cmake --build --preset ${{ matrix.cmake_preset }} | ||
- name: Upload firmware images artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: firmware-${{ matrix.cmake_preset }} | ||
path: | | ||
build/${{ matrix.cmake_preset }}/*.bin | ||
build/${{ matrix.cmake_preset }}/*.elf | ||
build/${{ matrix.cmake_preset }}/*.hex | ||
build/${{ matrix.cmake_preset }}/*.map | ||
run_clang_tidy: | ||
runs-on: ubuntu-latest | ||
container: docker.io/akospasztor/docker-gcc-arm:10-2020-q4-linux-2.2.0 | ||
needs: [check_format, check_style] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Run clang-tidy | ||
run: > | ||
cmake --preset Debug | ||
&& cmake --build --preset Debug --target tidy | ||
collect_artifacts: | ||
runs-on: ubuntu-latest | ||
needs: [build_doxygen, build_firmware, run_clang_tidy] | ||
steps: | ||
- name: Download doxygen html artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: doxygen-html | ||
path: doxygen/html | ||
- name: Display structure of downloaded files | ||
run: ls -al doxygen/html | ||
- name: Upload github-pages artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: doxygen/html | ||
deploy_pages: | ||
runs-on: ubuntu-latest | ||
needs: [collect_artifacts] | ||
# if: ${{ contains(github.ref, 'refs/tags/') }} | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
permissions: | ||
pages: write | ||
id-token: write | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |