diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2024-02-13 11:34:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-13 11:34:32 -0500 |
commit | ca4066feca64a310213b2e764f6214af82551034 (patch) | |
tree | 31be64eedee670ae3b17230ba6b05bc4a4222911 | |
parent | 771ece92d3bad54555665a4ea663fc91224a6de9 (diff) | |
parent | f847c9b1d74354e9ba7932495da42b3d9d710437 (diff) | |
download | stasis-ca4066feca64a310213b2e764f6214af82551034.tar.gz |
Merge pull request #1 from jhunkeler/jhunkeler-patch-1
Create cmake-multi-platform.yml
-rw-r--r-- | .github/workflows/cmake-multi-platform.yml | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml new file mode 100644 index 0000000..3b33958 --- /dev/null +++ b/.github/workflows/cmake-multi-platform.yml @@ -0,0 +1,58 @@ +name: CMake on multiple platforms + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + + matrix: + os: [ubuntu-latest, macos-latest] + build_type: [RelWithDebInfo] + c_compiler: [gcc, clang] + include: + - os: macos-latest + c_compiler: clang + - os: ubuntu-latest + c_compiler: gcc + - os: ubuntu-latest + c_compiler: clang + exclude: + - os: macos-latest + c_compiler: gcc + + steps: + - uses: actions/checkout@v3 + + - name: Set reusable strings + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Install Linux dependencies + if: matrix.os == 'ubuntu-latest' + run: > + sudo apt install -y libcurl4-openssl-dev rsync + + - name: Configure CMake + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} + + - name: Build + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + + # TODO: Write ctests + #- name: Test + # working-directory: ${{ steps.strings.outputs.build-output-dir }} + # run: ctest --build-config ${{ matrix.build_type }} |