Make CircleCI have feature parity with TravisCI and update docs
Unnecessary line from Bionic 18.04 was removed. A proper version guard was included for clang. Xenial currently ships 3.8.
This commit is contained in:
+83
-140
@@ -10,151 +10,94 @@ workflows:
|
|||||||
jobs:
|
jobs:
|
||||||
- clang-tidy
|
- clang-tidy
|
||||||
|
|
||||||
|
update_and_install_prereqs: &update_and_install_prereqs
|
||||||
|
- checkout
|
||||||
|
- run: apt-get update && apt-get upgrade -y
|
||||||
|
- run:
|
||||||
|
name: Get wget and apt-key
|
||||||
|
command: |
|
||||||
|
apt-get install wget -y
|
||||||
|
apt-get install software-properties-common -y
|
||||||
|
- run:
|
||||||
|
name: Set up LLVM-8 repo
|
||||||
|
command: |
|
||||||
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
|
||||||
|
add-apt-repository 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
|
||||||
|
add-apt-repository 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main'
|
||||||
|
apt update -qq
|
||||||
|
- run:
|
||||||
|
name: Install LLVM-8 binaries
|
||||||
|
command: |
|
||||||
|
apt install clang-format-8 -y
|
||||||
|
apt install clang-tidy-7 -y
|
||||||
|
apt install clang-8 -y
|
||||||
|
apt install clang -y
|
||||||
|
- run:
|
||||||
|
name: Run clang-format
|
||||||
|
command: python ./build_scripts/run-clang-format.py ./src -r --color always --clang-format-executable clang-format-8
|
||||||
|
- run:
|
||||||
|
name: Install g++-7
|
||||||
|
command: |
|
||||||
|
add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||||
|
apt update
|
||||||
|
apt install g++-7 -y
|
||||||
|
- run:
|
||||||
|
name: Add required QT repos
|
||||||
|
command: |
|
||||||
|
add-apt-repository ppa:beineri/opt-qt-5.12.2-xenial -y
|
||||||
|
apt-get update -qq
|
||||||
|
- run: apt-get install build-essential libgl1-mesa-dev -y
|
||||||
|
- run:
|
||||||
|
name: Install QT packages
|
||||||
|
command: |
|
||||||
|
apt-get install qt512-meta-minimal qt512multimedia qt512declarative qt512quickcontrols2 qt512tools qt512base qtchooser -y
|
||||||
|
- run:
|
||||||
|
name: Install X11 packages
|
||||||
|
command: apt-get install libx11-dev libxt-dev libxtst-dev -y
|
||||||
|
- run:
|
||||||
|
name: Install bear/clang-tidy
|
||||||
|
command: apt-get install bear clang-tidy -y
|
||||||
|
- run:
|
||||||
|
name: Set up qtchooser
|
||||||
|
command: qtchooser -install opt-qt512 /opt/qt512/bin/qmake
|
||||||
|
- run:
|
||||||
|
name: Give build scripts +x
|
||||||
|
command: |
|
||||||
|
chmod +x ./build_scripts/linux/build_linux.sh
|
||||||
|
chmod +x ./build_scripts/linux/format.sh
|
||||||
|
chmod +x ./build_scripts/linux/run-clang-tidy.sh
|
||||||
|
chmod +x ./build_scripts/linux/verify_formatting.sh
|
||||||
|
- run: clang --version
|
||||||
|
- run:
|
||||||
|
name: Run build script
|
||||||
|
command: ./build_scripts/linux/build_linux.sh
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
gcc:
|
gcc:
|
||||||
|
environment:
|
||||||
|
QMAKE_SPEC: linux-g++
|
||||||
|
QT_SELECT: opt-qt512
|
||||||
|
MAKE_JOBS: 2
|
||||||
docker:
|
docker:
|
||||||
- image: "ubuntu:xenial"
|
- image: "ubuntu:xenial"
|
||||||
steps:
|
steps: *update_and_install_prereqs
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: Set up env vars
|
|
||||||
command: echo 'export QMAKE_SPEC=linux-g++' >> $BASH_ENV; echo 'export QT_SELECT=opt-qt512' >> $BASH_ENV
|
|
||||||
- run:
|
|
||||||
name: Update and upgrade
|
|
||||||
command: ' apt-get update && apt-get upgrade -y'
|
|
||||||
- run:
|
|
||||||
name: Get wget
|
|
||||||
command: ' apt-get install wget -y; apt-get install software-properties-common -y'
|
|
||||||
- run:
|
|
||||||
name: Prereqs for clang-format-8
|
|
||||||
command: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -; add-apt-repository 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
|
|
||||||
- run:
|
|
||||||
name: Installing clang-format-8
|
|
||||||
command: ' apt update -qq; apt install clang-format-8 -y; clang-format-8 --version;'
|
|
||||||
- run:
|
|
||||||
name: Run clang-format
|
|
||||||
command: 'python ./build_scripts/run-clang-format.py ./src -r --color always --clang-format-executable clang-format-8'
|
|
||||||
- run:
|
|
||||||
name: Install g++-7
|
|
||||||
command: apt-get install -y software-properties-common; add-apt-repository ppa:ubuntu-toolchain-r/test; apt update; apt install g++-7 -y;
|
|
||||||
- run:
|
|
||||||
name: Install required packages
|
|
||||||
command: ' add-apt-repository ppa:kubuntu-ppa/backports -y; add-apt-repository ppa:beineri/opt-qt-5.12.2-xenial -y; apt-get update -qq; apt-get install build-essential libgl1-mesa-dev -y'
|
|
||||||
- run:
|
|
||||||
name: Install QT packages
|
|
||||||
command: ' apt-get install qt512-meta-minimal qt512multimedia qt512declarative qt512quickcontrols2 qt512tools qt512base qtchooser -y'
|
|
||||||
- run:
|
|
||||||
name: Install X11 packages
|
|
||||||
command: ' apt-get install libx11-dev libxt-dev libxtst-dev -y'
|
|
||||||
- run:
|
|
||||||
name: Install bear/clang-tidy
|
|
||||||
command: ' apt-get install bear clang-tidy -y'
|
|
||||||
- run:
|
|
||||||
name: Set up QT
|
|
||||||
command: 'qtchooser -install opt-qt512 /opt/qt512/bin/qmake'
|
|
||||||
- run:
|
|
||||||
name: Give build scripts +x
|
|
||||||
command: 'chmod +x ./build_scripts/linux/build_linux.sh; chmod +x ./build_scripts/linux/format.sh; chmod +x ./build_scripts/linux/run-clang-tidy.sh ;chmod +x ./build_scripts/linux/verify_formatting.sh'
|
|
||||||
- run:
|
|
||||||
name: Run build script
|
|
||||||
command: './build_scripts/linux/build_linux.sh'
|
|
||||||
clang:
|
clang:
|
||||||
|
environment:
|
||||||
|
QMAKE_SPEC: linux-clang
|
||||||
|
QT_SELECT: opt-qt512
|
||||||
|
MAKE_JOBS: 2
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/buildpack-deps:xenial
|
- image: "ubuntu:xenial"
|
||||||
steps:
|
steps: *update_and_install_prereqs
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: Set up env vars
|
|
||||||
command: echo 'export QMAKE_SPEC=linux-clang' >> $BASH_ENV; echo 'export QT_SELECT=opt-qt512' >> $BASH_ENV
|
|
||||||
- run:
|
|
||||||
name: Update and upgrade
|
|
||||||
command: 'sudo apt-get update && sudo apt-get upgrade -y'
|
|
||||||
- run:
|
|
||||||
name: Get wget
|
|
||||||
command: 'sudo apt-get install wget -y; sudo apt-get install software-properties-common -y'
|
|
||||||
- run:
|
|
||||||
name: Prereqs for clang-format-8
|
|
||||||
command: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -; sudo add-apt-repository 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
|
|
||||||
- run:
|
|
||||||
name: Installing clang-format-8
|
|
||||||
command: ' sudo apt update -qq; sudo apt install clang-format-8 -y; sudo clang-format-8 --version;'
|
|
||||||
- run:
|
|
||||||
name: Installing clang-8
|
|
||||||
command: 'sudo apt install clang-8 -y; sudo apt install clang -y; clang++ --version;'
|
|
||||||
- run:
|
|
||||||
name: Run clang-format
|
|
||||||
command: 'python ./build_scripts/run-clang-format.py ./src -r --color always --clang-format-executable clang-format-8'
|
|
||||||
- run:
|
|
||||||
name: Install g++-7
|
|
||||||
command: sudo apt-get install -y software-properties-common; sudo add-apt-repository ppa:ubuntu-toolchain-r/test; sudo apt update; sudo apt install g++-7 -y;
|
|
||||||
- run:
|
|
||||||
name: Install required packages
|
|
||||||
command: 'sudo add-apt-repository ppa:kubuntu-ppa/backports -y; sudo add-apt-repository ppa:beineri/opt-qt-5.12.2-xenial -y; sudo apt-get update -qq; sudo apt-get install build-essential libgl1-mesa-dev -y'
|
|
||||||
- run:
|
|
||||||
name: Install QT packages
|
|
||||||
command: 'sudo apt-get install qt512-meta-minimal qt512multimedia qt512declarative qt512quickcontrols2 qt512tools qt512base qtchooser -y'
|
|
||||||
- run:
|
|
||||||
name: Install X11 packages
|
|
||||||
command: ' sudo apt-get install libx11-dev libxt-dev libxtst-dev -y'
|
|
||||||
- run:
|
|
||||||
name: Install bear/clang-tidy
|
|
||||||
command: ' sudo apt-get install bear clang-tidy -y'
|
|
||||||
- run:
|
|
||||||
name: Set up QT
|
|
||||||
command: 'qtchooser -install opt-qt512 /opt/qt512/bin/qmake'
|
|
||||||
- run:
|
|
||||||
name: Give build scripts +x
|
|
||||||
command: 'chmod +x ./build_scripts/linux/build_linux.sh; chmod +x ./build_scripts/linux/format.sh; chmod +x ./build_scripts/linux/run-clang-tidy.sh ;chmod +x ./build_scripts/linux/verify_formatting.sh'
|
|
||||||
- run:
|
|
||||||
name: Run build script
|
|
||||||
command: './build_scripts/linux/build_linux.sh'
|
|
||||||
clang-tidy:
|
clang-tidy:
|
||||||
|
environment:
|
||||||
|
QMAKE_SPEC: linux-clang
|
||||||
|
QT_SELECT: opt-qt512
|
||||||
|
USE_TIDY: TRUE
|
||||||
|
MAKE_JOBS: 2
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/buildpack-deps:xenial
|
- image: "ubuntu:xenial"
|
||||||
steps:
|
steps: *update_and_install_prereqs
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: Set up env vars
|
|
||||||
command: echo 'export USE_TIDY=TRUE' >> $BASH_ENV; echo 'export QMAKE_SPEC=linux-clang' >> $BASH_ENV; echo 'export QT_SELECT=opt-qt512' >> $BASH_ENV
|
|
||||||
- run:
|
|
||||||
name: Update and upgrade
|
|
||||||
command: 'sudo apt-get update && sudo apt-get upgrade -y'
|
|
||||||
- run:
|
|
||||||
name: Get wget
|
|
||||||
command: 'sudo apt-get install wget -y; sudo apt-get install software-properties-common -y'
|
|
||||||
- run:
|
|
||||||
name: Prereqs for clang-format-8
|
|
||||||
command: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -; sudo add-apt-repository 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
|
|
||||||
- run:
|
|
||||||
name: Installing clang-format-8
|
|
||||||
command: ' sudo apt update -qq; sudo apt install clang-format-8 -y; sudo clang-format-8 --version;'
|
|
||||||
- run:
|
|
||||||
name: Installing clang-8
|
|
||||||
command: 'sudo apt install clang-8 -y; sudo apt install clang -y; clang++ --version;'
|
|
||||||
- run:
|
|
||||||
name: Run clang-format
|
|
||||||
command: 'python ./build_scripts/run-clang-format.py ./src -r --color always --clang-format-executable clang-format-8'
|
|
||||||
- run:
|
|
||||||
name: Install g++-7
|
|
||||||
command: sudo apt-get install -y software-properties-common; sudo add-apt-repository ppa:ubuntu-toolchain-r/test; sudo apt update; sudo apt install g++-7 -y;
|
|
||||||
- run:
|
|
||||||
name: Install required packages
|
|
||||||
command: 'sudo add-apt-repository ppa:kubuntu-ppa/backports -y; sudo add-apt-repository ppa:beineri/opt-qt-5.12.2-xenial -y; sudo apt-get update -qq; sudo apt-get install build-essential libgl1-mesa-dev -y'
|
|
||||||
- run:
|
|
||||||
name: Install QT packages
|
|
||||||
command: 'sudo apt-get install qt512-meta-minimal qt512multimedia qt512declarative qt512quickcontrols2 qt512tools qt512base qtchooser -y'
|
|
||||||
- run:
|
|
||||||
name: Install X11 packages
|
|
||||||
command: ' sudo apt-get install libx11-dev libxt-dev libxtst-dev -y'
|
|
||||||
- run:
|
|
||||||
name: Install bear/clang-tidy
|
|
||||||
command: ' sudo apt-get install bear clang-tidy -y'
|
|
||||||
- run:
|
|
||||||
name: Set up QT
|
|
||||||
command: 'qtchooser -install opt-qt512 /opt/qt512/bin/qmake'
|
|
||||||
- run:
|
|
||||||
name: Give build scripts +x
|
|
||||||
command: 'chmod +x ./build_scripts/linux/build_linux.sh; chmod +x ./build_scripts/linux/format.sh; chmod +x ./build_scripts/linux/run-clang-tidy.sh ;chmod +x ./build_scripts/linux/verify_formatting.sh'
|
|
||||||
- run:
|
|
||||||
name: Run build script
|
|
||||||
command: './build_scripts/linux/build_linux.sh'
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ if [[ -z $QMAKE_SPEC ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $USE_TIDY ]]; then
|
if [[ -z $USE_TIDY ]]; then
|
||||||
MAKE_COMMAND='make'
|
MAKE_COMMAND="make --jobs ${MAKE_JOBS}"
|
||||||
CLANG_TIDY=
|
CLANG_TIDY=
|
||||||
else
|
else
|
||||||
# Bear replaces the compile database, it does not update it.
|
# Bear replaces the compile database, it does not update it.
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
set +e
|
set +e
|
||||||
clang-tidy --version
|
clang-tidy-7 --version
|
||||||
|
|
||||||
ERROR=0
|
ERROR=0
|
||||||
for file in $(find ../src -name "*.cpp"); do
|
for file in $(find ../src -name "*.cpp"); do
|
||||||
echo $file
|
echo $file
|
||||||
clang-tidy $file
|
clang-tidy-7 $file
|
||||||
|
|
||||||
EXIT=$?
|
EXIT=$?
|
||||||
if [[ $EXIT != 0 ]]; then
|
if [[ $EXIT != 0 ]]; then
|
||||||
|
|||||||
@@ -1,14 +1,36 @@
|
|||||||
# Makes sure the "clang++" command used to invoke the compilation is abvove version 8.
|
# comments are the value of CLANG_VERSION
|
||||||
# If it's at or above version 7 then we can use the default clang++ otherwise we'll
|
CLANG_VERSION = $$system("clang --version | grep 'clang version'")
|
||||||
# specifically need clang++-8.
|
# clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
|
||||||
CLANG_VERSION = $$system("clang++ -dumpversion")
|
CLANG_VERSION = $$split(CLANG_VERSION, ' ')
|
||||||
!greaterThan(CLANG_VERSION, 7) {
|
# CLANG_VERSION is now a list, this is shown as spaces in QMAKE
|
||||||
message('clang++' version is not above 8. Manually using 'clang++-8'.)
|
# clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
|
||||||
!system(clang++-8 --version) {
|
CLANG_VERSION = $$member(CLANG_VERSION, 2)
|
||||||
error(At least clang++-8 required.)
|
# 6.0.0-1ubuntu2
|
||||||
|
CLANG_VERSION = $$split(CLANG_VERSION, '.')
|
||||||
|
# 6 0 0-1ubuntu2
|
||||||
|
CLANG_VERSION = $$member(CLANG_VERSION, 0)
|
||||||
|
# 6
|
||||||
|
|
||||||
|
greaterThan(CLANG_VERSION, 4) {
|
||||||
|
message('clang' version is above 4. Using regular clang.)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
system("clang-5 --version") {
|
||||||
|
QMAKE_CXX = clang-5
|
||||||
|
message('clang-5' found.)
|
||||||
|
}
|
||||||
|
system("clang-6 --version") {
|
||||||
|
QMAKE_CXX = clang-6
|
||||||
|
message('clang-6' found.)
|
||||||
|
}
|
||||||
|
system("clang-7 --version") {
|
||||||
|
QMAKE_CXX = clang-7
|
||||||
|
message('clang-7' found.)
|
||||||
|
}
|
||||||
|
system("clang-8 --version") {
|
||||||
|
QMAKE_CXX = clang-8
|
||||||
|
message('clang-8' found.)
|
||||||
}
|
}
|
||||||
#clang++-8 is needed for C++17 features. travis does not supply this by default.
|
|
||||||
QMAKE_CXX = clang++-8
|
|
||||||
}
|
}
|
||||||
|
|
||||||
include(clang-gcc-common-switches.pri)
|
include(clang-gcc-common-switches.pri)
|
||||||
|
|||||||
@@ -132,7 +132,6 @@ export QT_SELECT=opt-qt512
|
|||||||
|
|
||||||
## Ubuntu 18.04 Bionic
|
## Ubuntu 18.04 Bionic
|
||||||
```bash
|
```bash
|
||||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
|
||||||
sudo add-apt-repository ppa:beineri/opt-qt-5.12.2-bionic
|
sudo add-apt-repository ppa:beineri/opt-qt-5.12.2-bionic
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install g++-7
|
sudo apt install g++-7
|
||||||
@@ -166,8 +165,7 @@ The following environmental variables are relevant for building the project.
|
|||||||
| `USE_TIDY` | If set a compilation database will be created and the project linted. Can only be used with `clang`. |
|
| `USE_TIDY` | If set a compilation database will be created and the project linted. Can only be used with `clang`. |
|
||||||
| `NO_X11` | If set the application will be compiled without X11 specific libraries. This disables certain things like sending keystrokes from VR. |
|
| `NO_X11` | If set the application will be compiled without X11 specific libraries. This disables certain things like sending keystrokes from VR. |
|
||||||
| `NO_DBUS` | If set the application will be compiled without DBUS specific functionality. This disables certain things like media keys. |
|
| `NO_DBUS` | If set the application will be compiled without DBUS specific functionality. This disables certain things like media keys. |
|
||||||
|
| `MAKE_JOBS` | Argument to `make --jobs`. Defaults to nothing (unlimited amount of jobs). |
|
||||||
If an environment variable isn't set a default value will be provided. The default values are shown in the table below.
|
|
||||||
|
|
||||||
# Building
|
# Building
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user