Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dantti committed Nov 3, 2024
1 parent 55c74a8 commit 9aa9fe8
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 1 deletion.
79 changes: 79 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
# - ubuntu-24.04
- windows-latest
# - macos-latest
config:
- qt_version: "6.4.2"

steps:
- name: Install dependencies on Ubuntu
if: runner.os == 'Linux'
run: |
sudo apt update -qq
sudo apt install -y doxygen graphviz postgresql-server-dev-16
- name: Install dependencies on macOS
if: runner.os == 'macOS'
run: |
brew install postgresql@16
- name: Install PostgreSQL 16 with Chocolatey
if: runner.os == 'Windows'
run: |
choco install postgresql --version=16.0 -y
- name: Install Qt with options and default aqtversion
uses: jurplel/install-qt-action@v4
with:
aqtversion: null # use whatever the default is
version: ${{ matrix.config.qt_version }}
cache: true

- name: Install ninja-build tool (must be after Qt due PATH changes)
uses: turtlesec-no/get-ninja@main

- name: Make sure MSVC is found when Ninja generator is in use
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1

- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure project
run: >
cmake -S . -B ./build -G Ninja
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_PREFIX_PATH="/opt/homebrew/opt/postgresql@16;C:\Program Files\PostgreSQL\16"
-DENABLE_MAINTAINER_CFLAGS=${{ matrix.build_type == 'Debug' }}
-DBUILD_SHARED_LIBS=${{ matrix.build_type == 'Debug' }}
- name: Build project
run: cmake --build ./build

- name: Run tests
id: ctest
run: ctest --test-dir ./build -C Debug --output-on-failure

- name: Read tests log when it fails
uses: andstor/file-reader-action@v1
if: ${{ steps.ctest.conclusion == 'failure' }}
with:
path: "./build/Testing/Temporary/LastTest.log"
75 changes: 75 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Deploy API docs to GitHub Pages

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

push:
branches:
- master

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-24.04

steps:
- name: Install Dependencies on Linux
run: |
sudo apt update -qq
sudo apt install -y doxygen graphviz postgresql-server-dev-all
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
aqtversion: null # use whatever the default is
version: 6.6.0
cache: true
documentation: true
doc-archives: 'qtcore'

- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure project
run: >
cmake -S . -B ./build
-DBUILD_ALL=ON
-DPLUGIN_VIEW_CUTELEE=OFF
-DPLUGIN_VIEW_EMAIL=OFF
-DUSE_JEMALLOC=OFF
-DDOCS_QTDOCSDIR:PATH="${{ runner.workspace }}/Qt/Docs/Qt-6.6.0"
- name: Create docs
run: cmake --build ./build --target webdocs

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: build/webdocs/

# Deployment job, what was uploaded to artifact
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
53 changes: 53 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI Nightly

on:
workflow_dispatch:

schedule:
- cron: '0 3 * * *'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04

config:
- name: clang-tidy
cmake_arg: '-DCMAKE_CXX_CLANG_TIDY=clang-tidy'
qt_version: "6.7.3"

- name: clazy
cmake_arg: '-DCMAKE_CXX_COMPILER=clazy'
qt_version: "6.7.3"

steps:
- name: Install dependencies on Ubuntu
if: runner.os == 'Linux'
run: |
sudo apt update -qq
sudo apt install -y clazy doxygen graphviz postgresql-server-dev-all
- name: Install Qt ${{ matrix.config.qt_version }} with options and default aqtversion
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.config.qt_version }}
cache: true

- name: Install ninja-build tool (must be after Qt due PATH changes)
uses: turtlesec-no/get-ninja@main

- uses: actions/checkout@v4

- name: Configure project
run: >
cmake -S . -B ./build -G Ninja ${{ matrix.config.cmake_arg }}
-DCMAKE_BUILD_TYPE=Debug
--warn-uninitialized -Werror=dev
-DENABLE_MAINTAINER_CFLAGS=ON
- name: Build Project
run: cmake --build ./build
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
*.out
*.app

build
build*/
*.user

0 comments on commit 9aa9fe8

Please sign in to comment.