Skip to content

Commit 1c4711d

Browse files
authored
Merge pull request #4 from labstreaminglayer/ci
add github actions CI
2 parents d8ad501 + adb7aaa commit 1c4711d

13 files changed

Lines changed: 120 additions & 225 deletions

.appveyor.yml

Lines changed: 12 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,28 @@
1-
#: # Appveyor configuration ([source](../appskeleton/appveyor.yml))
2-
#: The AppVeyor configuration tells AppVeyor how to build the app.
3-
#: See the [AppVeyor documentation](https://www.appveyor.com/docs/appveyor-yml/)
4-
#: for specific questions.
5-
#:
6-
#: If you use this skeleton, you should only need to edit the following keys:
7-
#: - `version`: the package version
8-
#: - `deploy.username`: your username, even if you commit to the official repository
9-
#: - `deploy.api_key.secure`: your *encrypted* API key. Use the
10-
#: [encryption utility](https://ci.appveyor.com/tools/encrypt) to encrypt it.
111
version: 1.13.0.{build}
122
pull_requests:
133
do_not_increment_build_number: true
144
shallow_clone: true
15-
#: ## Environment variables
16-
#:
17-
#: Variables (`VAR`) defined here can be used in the build scripts (Windows: `%VAR%`, Linux: `${VAR}`).
18-
#:
19-
#: They can also be overridden in the build tool (`ci_console.html` in your local
20-
#: labstreaminglayer/labstreaminglayer repo) to build with a special configuration.
21-
#:
22-
#: each subgroup in `environment.matrix` will start a separate, clean build with the
23-
#: environment variables. This is useful in building on different operating systems
24-
#: (different `APPVEYOR_BUILD_WORKER_IMAGE`s) or compiler versions (i.e. through `VCVER`)
255
environment:
26-
lsltag: 1.13.0-b12
6+
lsltag: 1.13.0
277
lslversion: 1.13.0
288
LSLDIST_URL: "https://github.com/sccn/liblsl/releases/download"
299
CMakeArgs: ""
3010
matrix:
31-
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
32-
QTCOMPILER: msvc2017_64
33-
QTVER: 5.12
34-
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu1604
35-
DEPLOYNAME: Linux64-xenial
36-
#: # The `install` section
37-
#:
38-
#: List everything here to prepare the (clean) build server.
39-
#:
40-
#: Everything prefixed with `- cmd:` is only executed on windows,
41-
#: `- sh:` on Linux.
11+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
12+
QTCOMPILER: msvc2017_64
13+
QTVER: 5.13
14+
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu1804
15+
DEPLOYNAME: Linux64-bionic
4216
install:
43-
- cmd: appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip -FileName ninja.zip
44-
- cmd: appveyor DownloadFile %LSLDIST_URL%/%lsltag%/liblsl-%lslversion%-Win64.7z -FileName liblsl_x64.7z
45-
- cmd: 7z x ninja.zip
46-
- cmd: set PATH=%cd%;%PATH%
47-
- cmd: 7z x liblsl_x64.7z -oLSL
48-
- cmd: ninja --version
49-
- sh: set -x
17+
- cmd: appveyor DownloadFile %LSLDIST_URL%/%lsltag%/liblsl-%lslversion%-Win64.zip -FileName liblsl_x64.zip
18+
- cmd: 7z x liblsl_x64.zip -oLSL
5019
- sh: wget ${LSLDIST_URL}/${lsltag}/liblsl-${lslversion}-${DEPLOYNAME}.deb -O lsl.deb
51-
- sh: dpkg -x lsl.deb LSL
20+
- sh: sudo dpkg -i lsl.deb
5221
- sh: sudo apt update && sudo apt install -y qtbase5-dev
5322
build_script:
54-
- cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
55-
- cmd: cmake -S . -B build -G Ninja -DQt5_DIR=C:/Qt/%QTVER%/%QTCOMPILER%/lib/cmake/Qt5 -DBOOST_ROOT=C:/Libraries/boost_1_69_0 -DLSL_INSTALL_ROOT=LSL/ %CMakeArgs%
56-
- sh: cmake -S . -B build -DLSL_INSTALL_ROOT=LSL/usr -DLSL_UNIXFOLDERS=1 ${CMakeArgs}
57-
- cd build
58-
- cmake --build . --config Release --target install
59-
- cpack -C Release
60-
#: ## Artifacts
61-
#:
62-
#: If you want the built binaries in addition to the build log, you can define
63-
#: which paths (`path`) get compressed to which archives (`name`). You can use
64-
#: environment variables as placeholders (`$(lslversion)`).
23+
- cmd: cmake -S . -B build -DQt5_DIR=C:/Qt/%QTVER%/%QTCOMPILER%/lib/cmake/Qt5 -DLSL_INSTALL_ROOT=LSL/ %CMakeArgs% -A x64
24+
- sh: cmake -S . -B build -DLSL_UNIXFOLDERS=1 -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=1 ${CMakeArgs}
25+
- cmake --build build --config Release -j --target package
6526
artifacts:
6627
- path: 'build/*.deb'
6728
- path: 'build/*.tar.*'

.github/workflows/cppcmake.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: C/C++ CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
env:
12+
LSL_URL: 'https://github.com/sccn/liblsl/releases/download'
13+
LSL_RELEASE: '1.13.0'
14+
LSL_RELEASE_SUFFIX: ''
15+
16+
17+
jobs:
18+
build:
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
os:
23+
- ubuntu-latest
24+
- windows-latest
25+
- macOS-latest
26+
fail-fast: false
27+
steps:
28+
- uses: actions/checkout@v1
29+
- name: CMake version
30+
run: cmake --version
31+
- name: download liblsl (Ubuntu)
32+
run: |
33+
curl -L ${LSL_URL}/${LSL_RELEASE}${LSL_RELEASE_SUFFIX}/liblsl-${LSL_RELEASE}-Linux64-bionic.deb -o liblsl.deb
34+
sudo dpkg -i liblsl.deb
35+
sudo apt install -y qtbase5-dev
36+
if: matrix.os == 'ubuntu-latest'
37+
- name: download liblsl (Windows)
38+
run: |
39+
Invoke-WebRequest -Uri $Env:LSL_URL/$Env:LSL_RELEASE$Env:LSL_RELEASE_SUFFIX/liblsl-$Env:LSL_RELEASE-Win64.zip -o liblsl.7z
40+
7z x liblsl.7z -oLSL
41+
if: matrix.os == 'windows-latest'
42+
- name: download liblsl (macOS)
43+
run: |
44+
curl -L ${LSL_URL}/${LSL_RELEASE}${LSL_RELEASE_SUFFIX}/liblsl-${LSL_RELEASE}-OSX64.tar.bz2 -o liblsl.tar.bz2
45+
mkdir LSL
46+
tar -xvf liblsl.tar.bz2 -C LSL
47+
brew install qt
48+
echo '::set-env name=CMAKE_PREFIX_PATH::/usr/local/opt/qt'
49+
if: matrix.os == 'macOS-latest'
50+
- name: Install Qt
51+
# uses: jurplel/install-qt-action@v2
52+
uses: ouuan/install-qt-action@v2.3.1 # workaround until the aqtinstall timeout is fixed
53+
with:
54+
version: 5.14.0
55+
if: matrix.os == 'windows-latest'
56+
- name: Configure CMake
57+
shell: bash
58+
run: |
59+
cmake -S . -B build -DLSL_INSTALL_ROOT=$PWD/LSL/ -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON -DCPACK_DEBIAN_PACKAGE_DEPENDS=1
60+
- name: make
61+
run: cmake --build build --config Release -j
62+
- name: package
63+
run: cmake --build build --config Release -j --target install
64+
- uses: actions/upload-artifact@master
65+
with:
66+
name: pkg-${{ matrix.os }}
67+
path: build/install

.travis.yml

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,11 @@
1-
#: # `.travis.yml` ([source](../appskeleton/.travis.yml))
2-
#:
3-
#: `.travis.yml` tells [TravisCI](https://travis-ci.com) how to build the app.
4-
#:
5-
#: See the [TravisCI help pages](https://docs.travis-ci.com/).
6-
#:
7-
#: If you use this skeleton, you should only need to edit the following keys:
8-
#: - `matrix.include.os.addons.apt.packages`: additional packages required
9-
#: (e.g. `qt5-default` for Qt, `libboost-XY-dev` for Boost.XY)
10-
#: - `matrix.include.os.before_install` for OS X packages
11-
#: - deployment information. See [Deployment](#deployment).
12-
#:
13-
#: ## Basic configuration
14-
#:
15-
#: We compile with clang because it produces better error messages and is faster.
161
language: cpp
172
dist: xenial
183
compiler: clang
19-
#: The build environment variables.
20-
#: They can also be overridden in the build tool (`ci_console.html` in your local
21-
#: labstreaminglayer/labstreaminglayer repo) to build with a special configuration.
224
env:
235
LSLDIST_URL="https://github.com/sccn/liblsl/releases/download"
246
UBUNTU_DIST="xenial"
25-
LSL_VERSION="1.13.0-b12"
7+
LSL_VERSION="1.13.0"
268
- CMakeArgs=""
27-
#: ## Build environment setup
28-
#:
29-
#: Linux builds aren't enabled on Travis because the experience on Appveyor and
30-
#: Azure Pipelines is way better.
31-
#:
32-
#: On OS X, install packages via `brew` and download and extract liblsl.
339
matrix:
3410
include:
3511
- os: osx
@@ -42,10 +18,6 @@ matrix:
4218
- export LSL_INSTALL_ROOT=LSL
4319
- brew install qt
4420
- export CMAKE_PREFIX_PATH=/usr/local/opt/qt/
45-
#: ## `script` section
46-
#:
47-
#: Steps to build the app, copy the binaries to an "installation" folder and
48-
#: create `.dmg` packages on OS X and `.deb` packages on Linux.
4921
script:
5022
- mkdir -p build/install
5123
- cd build

CMakeLists.txt

Lines changed: 33 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
1-
#: # CMakeLists.txt ([source](../appskeleton/CMakeLists.txt))
2-
#:
3-
#: `CMakeLists.txt` contains the build configuration that can be used to build
4-
#: your App without any IDE or to generate project files for your specific IDE.
5-
#:
6-
#: ## Required settings for all apps
7-
cmake_minimum_required(VERSION 3.5)
8-
9-
#: This sets the minimum required CMake version.
10-
#: Here, [CMake 3.5](https://cmake.org/cmake/help/latest/release/3.5.html#modules)
11-
#: was chosen because it is the first version to support imported targets
12-
#: (e.g. `boost::thread`). Before setting this to a higher version, please check
13-
#: if it has arrived in [debian stable](https://packages.debian.org/stable/cmake).
14-
project(BestPracticesGUI
1+
# CMakeLists.txt contains the build configuration that can be used to build
2+
# your App without any IDE or to generate project files for your specific IDE.
3+
# First, set the minimum required CMake version.
4+
# Here, [CMake 3.10](https://cmake.org/cmake/help/latest/release/3.10.html)
5+
# was chosen. Before setting this to a higher version, please check
6+
# if it has arrived in
7+
# debian stable https://packages.debian.org/stable/cmake
8+
# and Ubuntu LTS https://packages.ubuntu.com/bionic/cmake
9+
cmake_minimum_required(VERSION 3.10)
10+
11+
project(AppTemplate_cpp_qt
1512
LANGUAGES CXX
16-
VERSION 1.13.0)
17-
18-
#: [project](https://cmake.org/cmake/help/latest/command/project.html) sets the
19-
#: name of the app, the languages used and the version. The version is later on
20-
#: used in the packages CMake creates for your app.
21-
22-
#: ## Finding liblsl
23-
#:
24-
#: Your app most likely requires liblsl, so CMake has to find it.
25-
#:
26-
#: The easiest way to find it using the Findliblsl.cmake find-module in the cmake subfolder.
27-
#: The newest version of Findliblsl.cmake should be available in the template app
28-
#: repository [here](https://github.com/labstreaminglayer/AppTemplate_cpp_qt/blob/master/cmake/Findliblsl.cmake).
13+
VERSION 1.13.0
14+
)
2915

16+
# also look for CMake modules in the cmake subfolder
3017
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
3118

32-
#: First we need to tell cmake to search in the `cmake` subfolder for cmake find-modules.
33-
34-
find_package(liblsl REQUIRED)
19+
# Find an installed liblsl in paths set by the user (LSL_INSTALL_ROOT)
20+
# and some default paths
21+
find_package(LSL REQUIRED
22+
HINTS ${LSL_INSTALL_ROOT}
23+
"${CMAKE_CURRENT_LIST_DIR}/../../LSL/liblsl/build/"
24+
"${CMAKE_CURRENT_LIST_DIR}/../../LSL/liblsl/out/build/x64-Release"
25+
PATH_SUFFIXES share/LSL)
26+
get_filename_component(LSL_PATH ${LSL_CONFIG} DIRECTORY)
27+
message(STATUS "Found LSL lib in ${LSL_PATH}")
28+
LSLAPP_Setup_Boilerplate()
3529

3630
#: Then we can simply use find_package. This enables us to later link LSL::lsl
3731
#: You can read more about [find_package](https://cmake.org/cmake/help/latest/command/find_package.html).
@@ -85,31 +79,22 @@ set(CMAKE_AUTORCC ON)
8579

8680
find_package(Qt5 REQUIRED COMPONENTS Widgets)
8781

88-
89-
#: ## Native threads
90-
#:
91-
#: Native `std::thread`s still require a platform thread library. CMake
92-
#: can find and link to it with the `Threads` package (link your executable with
93-
#: `Threads::Threads` afterwards).
94-
82+
# Native `std::thread`s still require a platform thread library.
83+
# CMake can find and link to it with the `Threads` package (link your
84+
# executable with `Threads::Threads` afterwards).
9585
find_package(Threads REQUIRED)
9686

97-
98-
#: If everything succeeds, you can link your app with the vendor SDK
99-
#: by linking to the imported target.
100-
#:
101-
#: ## Creating executables for your app
102-
#:
103-
#: Your app can have multiple executables. All of them are set up the same way:
87+
# Add executable targets, the default target has the same name as the project
10488

10589
add_executable(${PROJECT_NAME} MACOSX_BUNDLE WIN32
10690
main.cpp
10791
mainwindow.cpp
108-
mainwindow.h
92+
mainwindow.hpp
10993
mainwindow.ui
110-
reader.h
94+
reader.hpp
11195
reader.cpp
11296
)
97+
11398
target_link_libraries(${PROJECT_NAME}
11499
PRIVATE
115100
Qt5::Widgets
@@ -118,47 +103,11 @@ target_link_libraries(${PROJECT_NAME}
118103
# Vendor::DeviceModule
119104
)
120105

121-
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14)
122-
# target_compile_features(${PROJECT_NAME} PRIVATE cxx_auto_type cxx_lambda_init_captures)
123-
124-
#: [add_executable](https://cmake.org/cmake/help/latest/command/add_executable.html)
125-
#: tells CMake to take all files listed (even Qt `.ui` files), compile them and
126-
#: link them together. `MACOSX_BUNDLE` creates a bundle on OS X, `WIN32` tells
127-
#: Windows compilers not to show a command line window when launching the app.
128-
#:
129-
#: Using `${PROJECT_NAME}` as a placeholder for the executable name makes it easier
130-
#: to reuse parts of the `CMakeLists.txt` in other projects.
131-
#:
132-
#: [target_link_libraries](https://cmake.org/cmake/help/latest/command/target_link_libraries.html)
133-
#: tells CMake to add the include paths (and if necessary `#define`s) to the
134-
#: compiler command line and link to the libraries when producing a binary.
135-
#:
136-
#: If you want to use newer C++ features, either set the target standard version via
137-
#: [`set_property(... CXX_STANDARD 11)`](https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html)
138-
#: or explicitly enable features you need with
139-
#: [`target_compile_features`](https://cmake.org/cmake/help/latest/command/target_link_libraries.html)
140-
#: (see [`CMAKE_CXX_KNOWN_FEATURES`](https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html#prop_gbl:CMAKE_CXX_KNOWN_FEATURES)
141-
#: for a list.
142-
#:
143-
#: ## Setting up deployment
144-
#:
145-
#: You can also let CMake generate a zip / dmg file with everything needed to run
146-
#: your app:
106+
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
147107

108+
# Setting up deployment (let CPack generate a zip/dmg file)
148109
installLSLApp(${PROJECT_NAME})
149110
installLSLAuxFiles(${PROJECT_NAME}
150111
${PROJECT_NAME}.cfg
151112
)
152-
153113
LSLGenerateCPackConfig()
154-
#: `installLSLApp` creates an install target for the binary target, so that the
155-
#: CMake install target creates a directory for your app and copies the binary
156-
#: and all needed libraries (including Qt) to this folder.
157-
#:
158-
#: `installLSLAuxFiles` copies additional files needed (e.g. config files) to the
159-
#: distribution directory.
160-
#:
161-
#: `LSLGenerateCPackConfig` (has to be the last line!) generates a
162-
#: [CPack](https://cmake.org/Wiki/CMake:Packaging_With_CPack) configuration.
163-
#: CPack will then create packages (`.deb` on Linux, `.dmg` on OS X, `.zip` on
164-
#: Windows) that are easy to send someone and install on another computer.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The important source files are listed below:
1212

1313
- `main.cpp` is the entry point
1414
- `mainwindow.cpp` contains the UI code and code to access the recording device
15-
- `mainwindow.h` is the corresponding header
15+
- `mainwindow.hpp` is the corresponding header
1616

1717
## Dependencies
1818

0 commit comments

Comments
 (0)