Skip to content

Commit

Permalink
Add cmake.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jebos authored Jul 5, 2023
1 parent 6ae32df commit d70107b
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
qt-version: [5.15.2, 6.5.0]
include:
- os: windows-latest
compiler: msvc
- os: ubuntu-latest
compiler: clang

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt-version }}
arch: ${{ matrix.os == 'windows-latest' ? 'win64_msvc2019_64' : 'gcc_64' }}

- name: Setup Environment Variables (Windows)
if: matrix.os == 'windows-latest'
run: |
echo "QTDIR=${env:ProgramFiles(x86)}\Qt\${{ matrix.qt-version }}" >> $GITHUB_ENV
echo "Path=${env:Path};${env:ProgramFiles(x86)}\Qt\${{ matrix.qt-version }}\bin" >> $GITHUB_ENV
- name: Setup Environment Variables (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev
echo "QTDIR=/opt/qt${{ matrix.qt-version }}" >> $GITHUB_ENV
echo "Path=${env:Path}:/opt/qt${{ matrix.qt-version }}/bin" >> $GITHUB_ENV
- name: Install CMake
uses: lukka/[email protected]

- name: Configure
run: |
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH=$QTDIR ..
- name: Build
run: |
cd build
cmake --build . --config Release
- name: Test
run: |
cd build
ctest --output-on-failure

0 comments on commit d70107b

Please sign in to comment.