From 138281badfce32b5a1ad9b25e519d547640fe976 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Sat, 5 Aug 2017 14:05:50 +0200 Subject: [PATCH] Add CircleCI config.yml --- .circleci/config.yml | 122 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..51a2f499b --- /dev/null +++ b/.circleci/config.yml @@ -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 \ No newline at end of file