Bye bye Catch2, hello Google Test #45
Workflow file for this run
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: Main Workflow | |
on: [ push, pull_request ] | |
env: | |
LLVM_VERSION: 15 | |
jobs: | |
debug: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
container: ghcr.io/opencyphal/toolshed:ts22.4.3 | |
strategy: | |
matrix: | |
toolchain: [ 'clang', 'gcc' ] | |
include: | |
- toolchain: gcc | |
c-compiler: gcc | |
cxx-compiler: g++ | |
- toolchain: clang | |
c-compiler: clang | |
cxx-compiler: clang++ | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
# TODO https://github.com/OpenCyphal/docker_toolchains/issues/36 | |
dpkg --add-architecture i386 | |
apt-get update | |
apt-get install -y libgtest-dev libgtest-dev:i386 | |
gcc --version | |
clang --version | |
clang-tidy --version | |
find /usr -name 'libgtest*' | |
- run: > | |
cmake | |
-B ${{ github.workspace }}/build | |
-DCMAKE_BUILD_TYPE=Debug | |
-DCMAKE_C_COMPILER=${{ matrix.c-compiler }} | |
-DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }} | |
tests | |
- run: | | |
cd ${{ github.workspace }}/build | |
make VERBOSE=1 -j$(nproc) | |
make test | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
# The matrix is shown for convenience but this is fragile because the values may not be string-convertible. | |
# Shall it break one day, feel free to remove the matrix from here. | |
name: ${{github.job}}-#${{strategy.job-index}}-${{job.status}}-${{join(matrix.*, ',')}} | |
path: ${{github.workspace}}/**/* | |
retention-days: 2 | |
optimizations: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
container: ghcr.io/opencyphal/toolshed:ts22.4.3 | |
strategy: | |
matrix: | |
toolchain: [ 'clang', 'gcc' ] | |
build_type: [ Release, MinSizeRel ] | |
include: | |
- toolchain: gcc | |
c-compiler: gcc | |
cxx-compiler: g++ | |
- toolchain: clang | |
c-compiler: clang | |
cxx-compiler: clang++ | |
steps: | |
- uses: actions/checkout@v3 | |
- run: > | |
cmake | |
-B ${{ github.workspace }}/build | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-DCMAKE_C_COMPILER=${{ matrix.c-compiler }} | |
-DCMAKE_CXX_COMPILER=${{ matrix.cxx-compiler }} | |
-DNO_STATIC_ANALYSIS=1 | |
tests | |
- run: | | |
cd ${{ github.workspace }}/build | |
make VERBOSE=1 -j$(nproc) | |
make test | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
# The matrix is shown for convenience but this is fragile because the values may not be string-convertible. | |
# Shall it break one day, feel free to remove the matrix from here. | |
name: ${{github.job}}-#${{strategy.job-index}}-${{job.status}}-${{join(matrix.*, ',')}} | |
path: ${{github.workspace}}/**/* | |
retention-days: 2 | |
avr: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
env: | |
mcu: at90can64 | |
flags: -Wall -Wextra -Werror -pedantic -Wconversion -Wtype-limits | |
strategy: | |
matrix: | |
std: [ 'c99', 'c11', 'gnu99', 'gnu11' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
sudo apt update -y && sudo apt upgrade -y | |
sudo apt install gcc-avr avr-libc | |
avr-gcc --version | |
- run: avr-gcc libudpard/*.c -c -std=${{matrix.std}} -mmcu=${{env.mcu}} ${{env.flags}} | |
arm: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
env: | |
flags: -Wall -Wextra -Werror -pedantic -Wconversion -Wtype-limits -Wcast-align -Wfatal-errors | |
strategy: | |
matrix: | |
std: [ 'c99', 'c11', 'gnu99', 'gnu11' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
sudo apt update -y && sudo apt upgrade -y | |
sudo apt-get install -y gcc-arm-none-eabi | |
- run: arm-none-eabi-gcc libudpard/*.c -c -std=${{matrix.std}} ${{ env.flags }} | |
style_check: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: DoozyX/clang-format-lint-action@v0.15 | |
with: | |
source: './libudpard ./tests' | |
exclude: './tests/catch' | |
extensions: 'c,h,cpp,hpp' | |
clangFormatVersion: ${{ env.LLVM_VERSION }} |