From 054bd4ebea08c98130e0b667de9c10b860fdccd0 Mon Sep 17 00:00:00 2001 From: Snaipe Date: Thu, 20 Aug 2015 06:14:29 +0200 Subject: [PATCH] Cleaned up environment variables and added coveralls service name --- .cmake/Modules/CoverallsGenerateGcov.cmake | 13 +++++++++++-- appveyor.yml | 14 +++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.cmake/Modules/CoverallsGenerateGcov.cmake b/.cmake/Modules/CoverallsGenerateGcov.cmake index 429b695..b923f6e 100644 --- a/.cmake/Modules/CoverallsGenerateGcov.cmake +++ b/.cmake/Modules/CoverallsGenerateGcov.cmake @@ -268,8 +268,17 @@ foreach (GCOV_FILE ${ALL_GCOV_FILES}) endforeach() # TODO: Enable setting these -set(JSON_SERVICE_NAME "travis-ci") -set(JSON_SERVICE_JOB_ID $ENV{TRAVIS_JOB_ID}) +if (NOT DEFINED ENV{CI_NAME}) + set(JSON_SERVICE_NAME "travis-ci") +else () + set(JSON_SERVICE_NAME $ENV{CI_NAME}) +endif() + +if (NOT DEFINED ENV{CI_JOB_ID}) + set(JSON_SERVICE_JOB_ID $ENV{TRAVIS_JOB_ID}) +else () + set(JSON_SERVICE_JOB_ID $ENV{CI_JOB_ID}) +endif() set(JSON_REPO_TOKEN $ENV{COVERALLS_REPO_TOKEN}) set(JSON_TEMPLATE diff --git a/appveyor.yml b/appveyor.yml index 11aede3..666279c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,6 +9,10 @@ init: environment: COVERALLS_REPO_TOKEN: secure: 5nuCg+faxFPeppoNNcSwVobswAVFUf8ut83vw8CX/4W2y0kZkGmwEfCUxSQWiQDU + CI_NAME: appveyor + CI_JOB_ID: $(APPVEYOR_JOB_ID) + LOCAL_INSTALL: $(APPVEYOR_BUILD_FOLDER) + GCOV_PREFIX: $(APPVEYOR_BUILD_FOLDER) clone_depth: 5 @@ -21,10 +25,14 @@ platform: configuration: Release install: - - 'set GCOV_PREFIX=%APPVEYOR_BUILD_FOLDER%' - - 'set LOCAL_INSTALL=%APPVEYOR_BUILD_FOLDER%' + # Hack to make git think it is on the tip of the repo branch + - 'git checkout %APPVEYOR_REPO_BRANCH%' + - 'git reset --hard %APPVEYOR_REPO_COMMIT%' + # Install libcsptr - 'bash -lc "cd $APPVEYOR_BUILD_FOLDER; .ci/install-libcsptr.sh -G \"MSYS Makefiles\"; true"' + # We need to manually make since the above command somehow crashes - 'cd dependencies/libcsptr/build && make && make install && cd ../../../' + # Configure project - 'mkdir build && cd build' - 'cmake -DCMAKE_INSTALL_PREFIX=criterion-%APPVEYOR_REPO_TAG_NAME% -DCMAKE_PREFIX_PATH="%LOCAL_INSTALL%" -DCOVERALLS=ON -DCMAKE_BUILD_TYPE=Debug -G "MSYS Makefiles" ..' @@ -33,7 +41,7 @@ build_script: after_build: - 'make install' - - 'bash -lc "cd $APPVEYOR_BUILD_FOLDER; tar -cvjf criterion-${APPVEYOR_REPO_TAG_NAME}-windows-${PLATFORM}.tar.bz2 -C build criterion-${APPVEYOR_REPO_TAG_NAME}"' + - 'bash -lc "cd $APPVEYOR_BUILD_FOLDER; tar -cvjf criterion-${APPVEYOR_REPO_BRANCH}-windows-${PLATFORM}.tar.bz2 -C build criterion-${APPVEYOR_REPO_TAG_NAME}"' test_script: - 'make test || bash -lc "cat $APPVEYOR_BUILD_FOLDER/build/Testing/Temporary/LastTest.log"'