Add CircleCI config.yml

This commit is contained in:
Lukas W
2017-08-05 14:05:50 +02:00
parent 3401de4a83
commit 138281badf

122
.circleci/config.yml Normal file
View File

@@ -0,0 +1,122 @@
version: 2
shared:
restore_cache: &restore_cache
restore_cache:
keys:
- ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
- ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
- ccache-{{ arch }}
save_cache: &save_cache
save_cache:
key: ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .BuildNum }}
paths:
- ~/.ccache
ccache_stats: &ccache_stats
run:
name: Print ccache statistics
command: |
echo "[ccache config]"
ccache -p
echo "[ccache stats]"
ccache -s
# Commmon initializing commands
init: &init
run:
name: Initialize
command: |
mkdir -p /tmp/artifacts
# Commmon environment variables
common_environment: &common_environment
QT5: True
CMAKE_OPTS: -DWANT_QT5=ON -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_CCACHE=ON
CCACHE_MAXSIZE: 500M
CCACHE_LOGFILE: /tmp/artifacts/ccache.log
jobs:
mingw32:
environment:
<<: *common_environment
docker:
- image: lmmsci/linux.mingw32:14.04
steps:
- checkout
- *init
- *restore_cache
- run:
name: Building
command: |
mkdir build && cd build
../cmake/build_mingw32.sh
make -j6
- *ccache_stats
- *save_cache
mingw64:
environment:
<<: *common_environment
docker:
- image: lmmsci/linux.mingw64:14.04
steps:
- checkout
- *init
- *restore_cache
- run:
name: Building
command: |
mkdir build && cd build
../cmake/build_mingw64.sh
make -j6
- *ccache_stats
- *save_cache
linux.gcc:
docker:
- image: lmmsci/linux.gcc:14.04
environment:
<<: *common_environment
steps:
- checkout
- *init
- *restore_cache
- run:
name: Configure
command: mkdir build && cd build && cmake .. $CMAKE_OPTS -DCMAKE_INSTALL_PREFIX=./install
- run:
name: Build
command: cd build && make -j6
- run:
name: Build tests
command: cd build && make tests
- run:
name: Run tests
command: build/tests/tests
- *ccache_stats
- run:
name: Build AppImage
command: |
cd build
make install
make appimage
cp ./lmms-*.AppImage /tmp/artifacts/
- store_artifacts:
path: /tmp/artifacts/
destination: /
- *save_cache
shellcheck:
docker:
- image: koalaman/shellcheck-alpine:v0.4.6
steps:
- checkout
- run:
name: Shellcheck
command: shellcheck $(find "./cmake/" -type f -name '*.sh' -o -name "*.sh.in")
workflows:
version: 2
build-and-test:
jobs:
- mingw32
- mingw64
- linux.gcc
- shellcheck