Skip to content

(core/main): Adjust serial printfs #47

(core/main): Adjust serial printfs

(core/main): Adjust serial printfs #47

Workflow file for this run

name: CMake
# Run on any push or PR.
on: ["push", "pull_request"]
# Deploy job will only run on the "main" branch.
jobs:
build:
name: Build
strategy:
matrix:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
build-type: [Release, Debug, RelWithDebInfo, MinSizeRel]
# CMake is platform-agnostic.
runs-on: ubuntu-latest
steps:
- name: "(pkgs): Update package lists"
run: sudo apt-get update
- name: "(pkgs): Hold snapd, firefox"
run: sudo apt-mark hold snapd firefox
- name: "(pkgs): Upgrade packages"
run: sudo apt-get upgrade -y
- name: "(pkgs): Install toolchain"
run: sudo apt-get install -y cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential libstdc++-arm-none-eabi-newlib python3 git
- name: Checkout repository
uses: actions/checkout@v3
with:
# Checkout submodules (non-recursive)
submodules: 'true'
- name: Configure CMake
# Configure CMake in a 'build' subdirectory.
run: cmake -B ${{github.workspace}}/build -S ${{github.workspace}}/src -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
- name: Build
# Build the program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build-type }}
- name: "Upload Build Artifacts"
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.build-type }}
path: |
build/main_*.*
deploy:
name: Deploy Artifacts
needs: [build]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
# https://github.com/peaceiris/actions-gh-pages/tree/61cf177907e9ac9e79986e64f4e667fbfa975c04#:~:text=If%20the%20action%20fails%20to%20push%20the%20commit%20or%20tag%20with%20the%20following%20error%3A
# GitHub gives a 403, explicitly allow write permissions.
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# Checkout submodules (non-recursive)
submodules: 'true'
- name: "(pkgs): Update package lists"
run: sudo apt-get update
- name: "(pkgs): Install rename"
run: sudo apt-get install -y rename
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Rename artifact folders to lowercase
run: rename 'y/A-Z/a-z/' artifacts/*
- name: Create sha.txt file in artifact folder
run: git rev-parse HEAD > artifacts/sha.txt
- name: Upload artifacts to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: artifacts
destination_dir: builds/main/
keep_files: true
# Commit as github actions (noted on action README)
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
# - name: Test
# working-directory: ${{github.workspace}}/build
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C ${{ matrix.build-type }}