Skip to content

Add GitHub Actions workflow #4

Add GitHub Actions workflow

Add GitHub Actions workflow #4

Workflow file for this run

name: CI
on: push # when to trigger this. Here, on every push
jobs:
build_and_test:
name: "Build and test"
strategy:
matrix:
os: [ubuntu-latest, windows-latest] # we build on GitHub-provided Windows and Linux images
runs-on: ${{ matrix.os }} # use value from the matrix
steps:
- name: Install dependencies (linux)
run: sudo apt install ninja-build
if: matrix.os == 'ubuntu-latest' # conditional, runs this step only on the Ubuntu runner
- name: Install Ninja (windows) # Ninja is not available in GitHub-provided images,
# see https://github.com/actions/runner-images/issues/514
run: choco install ninja # So let's install it through Chocolatey
if: matrix.os == 'windows-latest'
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.5.2'
- uses: ilammy/msvc-dev-cmd@v1 # This action essentially calls vcvarsall.bat for the latest VS in the runner for x64
- uses: actions/checkout@v3 # Actually check out the sources. GH Actions can run for events that may not require
# sources (e.g. when someone comments on an issue)
# Here we call CMake manually, there are solutions for that in the Marketplace: https://github.com/marketplace/actions/run-cmake
- name: Build
# We don't need to set up the environment variable for CMake to see Qt because the install-qt-action
# sets up the necessary variables automatically
run: cmake -S . -B build -G "Ninja Multi-Config" && cmake --build build --config Debug