Skip to content

update workflow

update workflow #6

name: Rchan CMake Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
compiler:
- { cc: gcc-13, cxx: g++-13 }
- { cc: clang, cxx: clang++ }
steps:
- uses: actions/checkout@v4
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Install GCC 13 and dependencies
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-13 g++-13 cmake build-essential nlohmann-json3-dev
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_C_COMPILER=${{ matrix.compiler.cc }}
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Run Rchan tests
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: make testRchan
- name: Run Speed tests
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: make testSpeed
- name: Run CTest
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ matrix.build_type }} --output-on-failure