Skip to content

Commit

Permalink
Deploy 6c45caf to gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Deploy from CI committed Jul 1, 2024
0 parents commit 9b4746e
Show file tree
Hide file tree
Showing 134 changed files with 164,599 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright (C) 2016 Olivier Goffart <[email protected]>
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.

# This is the clang-format configuration style to be used by Qt,
# based on the rules from https://wiki.qt.io/Qt_Coding_Style and
# https://wiki.qt.io/Coding_Conventions

---
Language: Cpp
# Webkit style was loosely based on the Qt style
BasedOnStyle: WebKit

Standard: Cpp11
ColumnLimit: 120

# Disable reflow of qdoc comments: indentation rules are different.
# Translation comments are also excluded
CommentPragmas: "^!|^:"

# We want a space between the type and the star for pointer types
PointerBindsToType: false

# We want to break before the operators, but not before a '='
BreakBeforeBinaryOperators: NonAssignment

# Braces are usually attached, but not after functions or classes declaration
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
Cpp11BracedListStyle: true

# The coding style does not specify the following, but this is what gives
# results closest to the existing code.
AlignAfterOpenBracket: true
AlwaysBreakTemplateDeclarations: true

# Ideally we should also allow less short function in a single line, but
# clang-format does not handle that
AllowShortFunctionsOnASingleLine: Inline

# The coding style specifies some include order categories:
# #include "header_include.h"
# #include "module_includes.h"
# #include <dir/project_includes.h>
# #include <QIncludes>
# #include <cpp_includes>
SortIncludes: true

# Don't put lambda on one line, except empty
AllowShortLambdasOnASingleLine: Empty

# macros for which the opening brace stays attached
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]

---
Language: JavaScript
# Don't format .js files.
DisableFormat: true

---
Language: Json
# Don't format .json files
IndentWidth: 4
2 changes: 2 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CompileFlags:
Add: ['-std:c++latest']
2 changes: 2 additions & 0 deletions .clazy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CHECKS level0,level1,no-qproperty-without-notify,no-non-pod-global-static
SKIP /test_data/|/build-*/
16 changes: 16 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
mkdocs.yml text eol=lf
docs/API/**/*.md text eol=lf
test_data/tst_textdocument/loremipsum_lf_utf8.txt text eol=lf
test_data/tst_textdocument/loremipsum_crlf_ansi.txt text eol=crlf
test_data/tst_textdocument/loremipsum_crlf_utf8.txt text eol=crlf
test_data/tst_textdocument/loremipsum_crlf_utf8bom.txt text eol=crlf
test_data/tst_rcwriter/IDD_CHARPANEL_ANIMATION.ui text eol=lf
test_data/tst_rcwriter/IDD_LIGHTING.ui text eol=lf
test_data/tst_rcwriter/IDD_PANEL_DISPLAY_STEREO.ui text eol=lf
test_data/tst_rcwriter/IDD_PANEL_TERRAIN_MODIFY.ui text eol=lf
test_data/tst_rcwriter/IDD_ABCCOMPILE.ui text eol=lf
test_data/tst_rcwriter/IDD_CHARACTER_EDITOR_AUTO_EVENTS.ui text eol=lf
test_data/tst_rcwriter/qrc_expected_default.qrc text eol=lf
test_data/tst_rcwriter/qrc_expected_noalias_onlyexist.qrc text eol=lf
test_data/tst_settings/setValue/knut_expected.json text eol=lf
test_data/tst_settings/setValue/knut_original.json text eol=lf
166 changes: 166 additions & 0 deletions .github/workflows/knut-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: MIT

name: knut tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
pre_commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]

build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu
os: ubuntu-latest
compiler_cache_path: /home/runner/.cache/sccache
- name: Windows
os: windows-latest
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
- name: MacOS
os: macos-latest
compiler_cache_path: /Users/runner/Library/Caches/Mozilla.sccache

env:
SCCACHE_CACHE_SIZE: "2G"

steps:
- name: Inspect Environment Variables
run: env

- name: Checkout sources
uses: actions/checkout@v4

# Ideally, we'd simply like to replace this with:
# submodules: recursive
# on the "Checkout sources" step
# However, this is not possible, as the secret key to access the Github repository is not available from forks.
# So we need to conditionally check for the secret key.
- name: Checkout submodules
run: |
git submodule update --init --force --depth=1 --recursive -- '3rdparty/extra-cmake-modules'
git submodule update --init --force --depth=1 --recursive -- '3rdparty/kdalgorithms'
git submodule update --init --force --depth=1 --recursive -- '3rdparty/ksyntaxhighlighting'
git submodule update --init --force --depth=1 --recursive -- '3rdparty/nlohmann-json'
git submodule update --init --force --depth=1 --recursive -- '3rdparty/pugixml'
git submodule update --init --force --depth=1 --recursive -- '3rdparty/spdlog'
git submodule update --init --force --depth=1 --recursive -- '3rdparty/tree-sitter'
git submodule update --init --force --depth=1 --recursive -- '3rdparty/tree-sitter-cpp'
- name: Configure SSH for connection to codereview.kdab.com (main repo only)
uses: shimataro/ssh-key-action@v2
# The GERRIT_SSH_KEY is only available in the main knut repo **after** merging a PR
# So only run this step if that's the case.
if: ${{ github.repository == 'KDAB/knut' && github.event_name == 'push' }}
with:
key: ${{ secrets.GERRIT_SSH_KEY }}
name: id_knut-github-gerrit-access
known_hosts: "[codereview.kdab.com]:29418 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII7rIogDqC3Za+LV37295k312ihzhH/HsSNDE6+VHQMF"
config: |
Host codereview.kdab.com
HostName codereview.kdab.com
User knut-github-gerrit-access
IdentityFile ~/.ssh/id_knut-github-gerrit-access
- name: Checkout private submodules (main repo only)
# The GERRIT_SSH_KEY is only available in the main knut repo **after** merging a PR
# So only run this step if that's the case.
if: ${{ github.repository == 'KDAB/knut' && github.event_name == 'push' }}
run: |
git submodule update --init --force --depth=1 --recursive -- '3rdparty/photonwidgets'
git submodule update --init --force --depth=1 --recursive -- '3rdparty/mfc-utils'
- name: Install ninja-build tool
uses: aseprite/get-ninja@main

- name: Install Qt 6
uses: jurplel/install-qt-action@v4
with:
version: 6.5.* # 6.5 is the current LTS (as of 2024-06-06)
cache: true

- name: Make sure MSVC is found when Ninja generator is in use
uses: ilammy/msvc-dev-cmd@v1

# Note: The Compiler cache steps were adapted from the CXX-Qt repository (https://github.com/kdab/cxx-qt)
#
# We want our compiler cache to always update to the newest state.
# The best way for us to achieve this is to **always** update the cache after every landed commit.
# That way it will closely follow our development.
# And if a PR diverges a lot with its cache that's not a big deal, as it will be merged eventually.
#
# This is a workaround for the fact that GH doesn't support updating existing caches.
# See: https://github.com/azu/github-actions-overwrite-cache-example
#
# Ideally we'd like to use this:
# - name: "Compiler cache"
# uses: actions/cache@v4
# with:
# update: true <------- THIS DOESN'T EXIST YET
# path: ${{ matrix.compiler_cache_path }}
# key: ${{ matrix.name }}_compiler_cache
- name: "Restore Compiler Cache"
id: compiler-cache-restore
uses: actions/cache/restore@v4
with:
path: ${{ matrix.compiler_cache_path }}
key: ${{ matrix.os }}_compiler_cache

- name: Run sccache-cache
uses: mozilla-actions/[email protected]

- name: Configure project
run: cmake -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache --preset=ci

- name: Build Project
run: cmake --build --preset=ci

- name: Run tests
run: ctest --preset=ci

# We only upload artifacts if building or testing has failed
# That way we can debug if necessary, but don't pay the 30s-60s
# of upload time if everything is going well.
- name: Output the build results as an artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: knut-binaries-${{ matrix.os }}-${{ github.head_ref || github.ref_name }}
path: build-ci/bin/
overwrite: true

# This is a workaround for the fact that GH doesn't support updating existing caches.
# See: https://github.com/azu/github-actions-overwrite-cache-example
- name: "Delete previous compiler cache"
# Updating th cache doesn't work from forks
# So update it once it's merged into the repo
if: ${{ steps.compiler-cache-restore.outputs.cache-hit && github.event_name == 'push' }}
continue-on-error: true
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete "${{ matrix.os }}_compiler_cache" --confirm
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Save Compiler Cache"
uses: actions/cache/save@v4
# Updating th cache doesn't work from forks
# So update it once it's merged into the repo
if: ${{ github.event_name == 'push' }}
with:
path: ${{ matrix.compiler_cache_path }}
key: ${{ matrix.os }}_compiler_cache
91 changes: 91 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------

*~
*.autosave
*.a
*.core
*.moc
*.o
*.obj
*.orig
*.rej
*.so
*.so.*
*_pch.h.cpp
*_resource.rc
*.qm
.#*
*.*#
core
!core/
tags
.DS_Store
.directory
*.debug
Makefile*
*.prl
*.app
moc_*.cpp
ui_*.h
qrc_*.cpp
Thumbs.db
*.res
/.qmake.cache
/.qmake.stash

# qtcreator generated files
*.pro.user*

# xemacs temporary files
*.flc

# Vim temporary files
.*.swp

# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.ncb
*.sdf
*.opensdf
*.vcxproj
*vcxproj.*

# MinGW generated files
*.Debug
*.Release

# Python byte code
*.pyc

# Binaries
# --------
*.dll
*.exe

CMakeLists.txt.user
CMakeLists.txt.user.*
*.spv
.vs/*
imgui.ini

build*/
site/

.cache/
compile_commands.json

cpp_messages.log
cpp_server.log
docs/assets/*.svg

.vscode

.idea
31 changes: 31 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[submodule "3rdparty/spdlog"]
path = 3rdparty/spdlog
url = https://github.com/gabime/spdlog.git
[submodule "3rdparty/nlohmann-json"]
path = 3rdparty/nlohmann-json
url = https://github.com/nlohmann/json
[submodule "3rdparty/pugixml"]
path = 3rdparty/pugixml
url = https://github.com/zeux/pugixml.git
[submodule "3rdparty/kdalgorithms"]
path = 3rdparty/kdalgorithms
url = https://github.com/KDAB/KDAlgorithms
[submodule "3rdparty/ksyntaxhighlighting"]
path = 3rdparty/ksyntaxhighlighting
url = https://github.com/KDE/syntax-highlighting.git
ignore = dirty
[submodule "3rdparty/extra-cmake-modules"]
path = 3rdparty/extra-cmake-modules
url = https://github.com/KDE/extra-cmake-modules
[submodule "3rdparty/tree-sitter"]
path = 3rdparty/tree-sitter
url = https://github.com/tree-sitter/tree-sitter.git
[submodule "3rdparty/tree-sitter-cpp"]
path = 3rdparty/tree-sitter-cpp
url = https://github.com/tree-sitter/tree-sitter-cpp
[submodule "3rdparty/mfc-utils"]
path = 3rdparty/mfc-utils
url = ssh://codereview.kdab.com:29418/kdab/mfc-utils
[submodule "3rdparty/photonwidgets"]
path = 3rdparty/photonwidgets
url = ssh://codereview.kdab.com:29418/photonwidgets
5 changes: 5 additions & 0 deletions .gitreview
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[gerrit]
host=codereview.kdab.com
port=29418
project=knut
defaultbranch=master
Loading

0 comments on commit 9b4746e

Please sign in to comment.