From d19b73db775c4e5f68bfedb1844ce73c7a4ecd38 Mon Sep 17 00:00:00 2001 From: Learath Date: Fri, 10 Aug 2018 18:59:56 +0300 Subject: [PATCH 1/3] Try migrate to CircleCI2. Fix #1229 --- .circleci/config.yml | 79 ++++++++++++++++++++++++++++++++++++++++++++ circle.yml | 50 ---------------------------- 2 files changed, 79 insertions(+), 50 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..f97566bd4 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,79 @@ +version: 2 +defaults: &defaults + working_directory: ~/ddnet/ddnet + docker: + - image: buildpack-deps:stretch + +jobs: + pre_test: + <<: *defaults + parallelism: 1 + steps: + - checkout + - run: python scripts/check_header_guards.py + + build: + <<: *defaults + parallelism: 1 + #environment: + #CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + #CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + + steps: + - checkout + #- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS + - run: git submodule update --init + + - run: | + apt-get update + apt-get install -y build-essential \ + python3 \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libsdl2-dev \ + libglew-dev \ + libogg-dev \ + libopus-dev \ + libpnglite-dev \ + libopusfile-dev \ + libwavpack-dev + apt-get install -y cmake xz-utils + + # Compile + - run: python scripts/check_header_guards.py + - run: | + mkdir build + cd build + env CFLAGS="-Wdeclaration-after-statement -Werror" CXXFLAGS="-Werror" cmake -DDOWNLOAD_GTEST=ON .. + make everything + + - persist-to-workspace: + root: ./ + paths: ./* + + test: + <<: *defaults + steps: + - attach-workspace: + at: ./ + + - run: | + apt-get update + apt-get install -y make cmake xz-utils + + - run: | + cd build + make run_tests + ./DDNet-Server shutdown + +workflows: + version: 2 + build_and_test: + jobs: + - pre_test + - build: + requires: + - pre_test + - test: + requires: + - build diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 255053582..000000000 --- a/circle.yml +++ /dev/null @@ -1,50 +0,0 @@ -dependencies: - override: - - | - sudo add-apt-repository -y ppa:zoogie/sdl2-snapshots - sudo apt-get update - sudo apt-get build-dep teeworlds - sudo apt-get install cmake libsdl2-dev xz-utils - -checkout: - post: - - git submodule update --init - -## Customize test commands -compile: - override: - - python scripts/check_header_guards.py - - - | - mkdir build - cd build - env CFLAGS="-Wdeclaration-after-statement -Werror" CXXFLAGS="-Werror" cmake -DDOWNLOAD_GTEST=ON .. - make everything - -test: - override: - - | - cd build - make run_tests - ./DDNet-Server shutdown - - - | - cd build - make package - mv DDNet-*.tar.* ${CIRCLE_ARTIFACTS} - -branches: - ignore: - - staging.tmp - - testing.tmp - -## -##deployment: -## master: -## branch: master -## owner: ddnet -## commands: -## - | -## cd build -## make package -## mv DDNet-*.tar.* From 36704d5dad7eca25e865d0c53aeb502dd0ee18b3 Mon Sep 17 00:00:00 2001 From: Learath Date: Fri, 10 Aug 2018 19:10:15 +0300 Subject: [PATCH 2/3] Try a prebuilt container --- .circleci/config.yml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f97566bd4..a8b1158ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 defaults: &defaults working_directory: ~/ddnet/ddnet docker: - - image: buildpack-deps:stretch + - image: learath2/ddnet-env:v1 jobs: pre_test: @@ -24,21 +24,6 @@ jobs: #- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - run: git submodule update --init - - run: | - apt-get update - apt-get install -y build-essential \ - python3 \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libsdl2-dev \ - libglew-dev \ - libogg-dev \ - libopus-dev \ - libpnglite-dev \ - libopusfile-dev \ - libwavpack-dev - apt-get install -y cmake xz-utils - # Compile - run: python scripts/check_header_guards.py - run: | @@ -57,10 +42,6 @@ jobs: - attach-workspace: at: ./ - - run: | - apt-get update - apt-get install -y make cmake xz-utils - - run: | cd build make run_tests From 607b71860b99d87f1d55fb0d7003095078806fbb Mon Sep 17 00:00:00 2001 From: Learath Date: Wed, 15 Aug 2018 15:47:55 +0300 Subject: [PATCH 3/3] Install deps on the fly This reverts commit 36704d5dad7eca25e865d0c53aeb502dd0ee18b3. --- .circleci/config.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a8b1158ce..f97566bd4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 defaults: &defaults working_directory: ~/ddnet/ddnet docker: - - image: learath2/ddnet-env:v1 + - image: buildpack-deps:stretch jobs: pre_test: @@ -24,6 +24,21 @@ jobs: #- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - run: git submodule update --init + - run: | + apt-get update + apt-get install -y build-essential \ + python3 \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libsdl2-dev \ + libglew-dev \ + libogg-dev \ + libopus-dev \ + libpnglite-dev \ + libopusfile-dev \ + libwavpack-dev + apt-get install -y cmake xz-utils + # Compile - run: python scripts/check_header_guards.py - run: | @@ -42,6 +57,10 @@ jobs: - attach-workspace: at: ./ + - run: | + apt-get update + apt-get install -y make cmake xz-utils + - run: | cd build make run_tests