Adding test build to CI
This commit is contained in:
parent
5ef40e2832
commit
4897f2ae6f
@ -1,28 +1,35 @@
|
|||||||
# requiring the environment of NodeJS 8 LTS series (carbon)
|
|
||||||
image: node:carbon
|
|
||||||
|
|
||||||
# add 'node_modules' to cache for speeding up builds
|
test_code:
|
||||||
|
image: rootproject/root-ubuntu16:6.12
|
||||||
|
stage: test
|
||||||
|
before_script:
|
||||||
|
- mkdir -p $HOME/.local
|
||||||
|
- curl -s "https://cmake.org/files/v3.11/cmake-3.11.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C $HOME/.local
|
||||||
|
- export PATH=$HOME/.local/bin:$PATH
|
||||||
|
script:
|
||||||
|
- mkdir -p build
|
||||||
|
- cd build
|
||||||
|
- cmake ../examples
|
||||||
|
- cmake --build .
|
||||||
|
- ctest
|
||||||
|
- cd ..
|
||||||
|
|
||||||
|
pages:
|
||||||
|
image: node:carbon
|
||||||
|
stage: deploy
|
||||||
|
only:
|
||||||
|
- master
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- node_modules/ # Node modules and dependencies
|
- node_modules/
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- npm install gitbook-cli -g # install gitbook
|
- npm install gitbook-cli -g #
|
||||||
- gitbook fetch latest # fetch latest stable version
|
- gitbook fetch latest
|
||||||
- gitbook install # add any requested plugins in book.json
|
- gitbook install
|
||||||
#- gitbook fetch pre # fetch latest pre-release version
|
|
||||||
#- gitbook fetch 2.6.7 # fetch specific version
|
|
||||||
|
|
||||||
|
|
||||||
# the 'pages' job will deploy and build your site to the 'public' path
|
|
||||||
pages:
|
|
||||||
stage: deploy
|
|
||||||
script:
|
script:
|
||||||
- gitbook build . public # build to public path
|
- gitbook build . public
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
only:
|
|
||||||
- master # this job will affect only the 'master' branch
|
|
||||||
|
|
||||||
|
@ -19,13 +19,15 @@ On Linux, there are binaries provided, but you'll need to pick an install locati
|
|||||||
If you just want a local folder with CMake only:
|
If you just want a local folder with CMake only:
|
||||||
|
|
||||||
{% term %}
|
{% term %}
|
||||||
~ $ mkdir -p cmake-3.11 && wget -qO- "https://cmake.org/files/v3.11/cmake-3.11.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C cmake39
|
~ $ mkdir -p cmake-3.11 && wget -qO- "https://cmake.org/files/v3.11/cmake-3.11.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C cmake-3.11
|
||||||
~ $ export PATH=`pwd`/cmake-3.11/bin:$PATH
|
~ $ export PATH=`pwd`/cmake-3.11/bin:$PATH
|
||||||
{% endterm %}
|
{% endterm %}
|
||||||
|
|
||||||
You'll obviously want to append to the PATH every time you start a new terminal, or add it to your `.bashrc` or to an [LMod] system.
|
You'll obviously want to append to the PATH every time you start a new terminal, or add it to your `.bashrc` or to an [LMod] system.
|
||||||
|
|
||||||
And, if you want a system install, install to `/usr/local`. (I'm only brave enough to do this in Docker).
|
And, if you want a system install, install to `/usr/local`; this is an excellent choice in a Docker container, for example on GitLab CI. I don't think I'd try it on a non-containerized system.
|
||||||
|
|
||||||
|
If you are on a system without wget, replace `wget -qO-` with `curl -s`.
|
||||||
|
|
||||||
You can also build CMake on any system, it's pretty easy, but binaries are faster.
|
You can also build CMake on any system, it's pretty easy, but binaries are faster.
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ Even more modules provide imported targets, including MPI.
|
|||||||
* CUDA supported for Windows
|
* CUDA supported for Windows
|
||||||
* Better object library support in several situations
|
* Better object library support in several situations
|
||||||
* `DESCRIPTION` added to `project`
|
* `DESCRIPTION` added to `project`
|
||||||
* `seperate_arguments` gets `NATIVE_COMMAND`
|
* `separate_arguments` gets `NATIVE_COMMAND`
|
||||||
* `INTERPROCEDURAL_OPTIMIZATION` enforced (and `CMAKE_*` initializer added, CheckIPOSupported added, Clang and GCC support)
|
* `INTERPROCEDURAL_OPTIMIZATION` enforced (and `CMAKE_*` initializer added, CheckIPOSupported added, Clang and GCC support)
|
||||||
* New `GoogleTest` module
|
* New `GoogleTest` module
|
||||||
* `FindDoxygen` drastically improved
|
* `FindDoxygen` drastically improved
|
||||||
|
@ -59,3 +59,14 @@ These are common CMake options to most packages:
|
|||||||
* `-DCMAKE_BUILD_TYPE=` Pick from Release, RelWithDebInfo, Debug, or sometimes more.
|
* `-DCMAKE_BUILD_TYPE=` Pick from Release, RelWithDebInfo, Debug, or sometimes more.
|
||||||
* `-DCMAKE_INSTALL_PREFIX=` The location to install to. System install on UNIX would often be `/usr/local` (the default), user directories are often `~/.local`, or you can pick a folder.
|
* `-DCMAKE_INSTALL_PREFIX=` The location to install to. System install on UNIX would often be `/usr/local` (the default), user directories are often `~/.local`, or you can pick a folder.
|
||||||
* `-D BUILD_SHARED_LIBS=` You can set this `ON` or `OFF` to control the default for shared libraries (the author can pick one vs. the other explicitly instead of using the default, though)
|
* `-D BUILD_SHARED_LIBS=` You can set this `ON` or `OFF` to control the default for shared libraries (the author can pick one vs. the other explicitly instead of using the default, though)
|
||||||
|
|
||||||
|
## Special commands for CMake
|
||||||
|
|
||||||
|
We've already mentioned several special commands, like `-G` for generator, but here is a listing of some other useful flags:
|
||||||
|
|
||||||
|
| Flag | Description |
|
||||||
|
|-----:|:------------|
|
||||||
|
| `-G"Generator"` | Select a generator |
|
||||||
|
| `--trace` | Print every line of CMake that is run. Very verbose. |
|
||||||
|
| `--trace-source="filename"` | Print out every line of a CMake file when it runs. Very useful. |
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ project(RootSimpleExample311 LANGUAGES CXX)
|
|||||||
find_package(ROOT CONFIG REQUIRED)
|
find_package(ROOT CONFIG REQUIRED)
|
||||||
message(STATUS "Found ROOT: ${ROOT_VERSION} at ${ROOT_DIR}")
|
message(STATUS "Found ROOT: ${ROOT_VERSION} at ${ROOT_DIR}")
|
||||||
|
|
||||||
seperate_arguments(ROOT_CXX_FLAGS)
|
separate_arguments(ROOT_CXX_FLAGS)
|
||||||
|
|
||||||
## [modern_fix]
|
## [modern_fix]
|
||||||
target_include_directories(ROOT::Core INTERFACE "${ROOT_INCLUDE_DIRS}")
|
target_include_directories(ROOT::Core INTERFACE "${ROOT_INCLUDE_DIRS}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user