From 203930332e9e2a73838c97a96c68a24c7e30ad6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Tue, 16 May 2017 16:46:23 +0200 Subject: [build] add Danger check for correct submodule pin --- .travis.yml | 11 ++++++ appveyor.yml | 112 +++++++++++++++++++++++++++++----------------------------- circle.yml | 70 ++++++++++++++++++------------------ dangerfile.js | 15 ++++++++ package.json | 2 ++ 5 files changed, 119 insertions(+), 91 deletions(-) create mode 100644 .travis.yml create mode 100644 dangerfile.js diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..00e38e76eb --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +node_js: + - "8" + +sudo: false + +install: + - npm install --ignore-scripts + +script: + - npm run danger-ci diff --git a/appveyor.yml b/appveyor.yml index fa5b08bcf9..a3fe031457 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,56 +1,56 @@ -os: Visual Studio 2015 -platform: x64 - -environment: - matrix: - - configuration: Release - -shallow_clone: true - -branches: - only: - - master - -cache: - - '%APPVEYOR_BUILD_FOLDER%\mason_packages' - - '%APPVEYOR_BUILD_FOLDER%\LLVM-5.0.1-win64.exe' - - '%APPVEYOR_BUILD_FOLDER%\cmake-3.10.1-win64-x64.zip' - -install: - - ps: | - if (!(Test-Path LLVM-5.0.1-win64.exe)) { - appveyor DownloadFile https://releases.llvm.org/5.0.1/LLVM-5.0.1-win64.exe - } - scripts\check-sha256.ps1 LLVM-5.0.1-win64.exe 981543611D719624ACB29A2CFFD6A479CFF36E8AB5EE8A57D8ECA4F9C4C6956F - Start-Process -FilePath 'LLVM-5.0.1-win64.exe' -ArgumentList '/S','/D=C:\LLVM-5.0.1' -Wait - - ps: | - if (!(Test-Path cmake-3.10.1-win64-x64.zip)) { - appveyor DownloadFile https://cmake.org/files/v3.10/cmake-3.10.1-win64-x64.zip - } - scripts\check-sha256.ps1 cmake-3.10.1-win64-x64.zip 8251F70C85B58F3CA1F24E4A3B0637E2D609B5E4A341D00B70E02E89244D5029 - Start-Process -FilePath '7z' -ArgumentList 'x','cmake-3.10.1-win64-x64.zip','-oC:\' -Wait - -before_build: - - set PATH=C:\LLVM-5.0.1\msbuild-bin;%PATH% - - set PATH=C:\cmake-3.10.1-win64-x64\bin;%PATH% - - set QT_CMAKE=C:\Qt\5.7\msvc2015_64\lib\cmake - - mkdir %APPVEYOR_BUILD_FOLDER%\build - - cd %APPVEYOR_BUILD_FOLDER%\build - -build_script: - - cmake -G "Visual Studio 14 2015 Win64" -T LLVM-vs2014 -DMBGL_PLATFORM=qt -DWITH_QT_DECODERS=ON -DWITH_QT_I18N=ON -DWITH_NODEJS=OFF -DCMAKE_PREFIX_PATH=%QT_CMAKE% %APPVEYOR_BUILD_FOLDER% & exit 0 - - cmake --build . --config Release --target qmapboxgl -- /m - -after_build: - - mkdir qmapboxgl - - mkdir qmapboxgl\lib - - mkdir qmapboxgl\include - - copy Release\qmapboxgl.* qmapboxgl\lib - - copy %APPVEYOR_BUILD_FOLDER%\platform\qt\include\* qmapboxgl\include - - 7z a qmapboxgl-%APPVEYOR_REPO_COMMIT%.zip qmapboxgl - -artifacts: - - path: build\qmapboxgl-%APPVEYOR_REPO_COMMIT%.zip - name: QMapboxGL - -test: off +# os: Visual Studio 2015 +# platform: x64 + +# environment: +# matrix: +# - configuration: Release + +# shallow_clone: true + +# branches: +# only: +# - master + +# cache: +# - '%APPVEYOR_BUILD_FOLDER%\mason_packages' +# - '%APPVEYOR_BUILD_FOLDER%\LLVM-5.0.1-win64.exe' +# - '%APPVEYOR_BUILD_FOLDER%\cmake-3.10.1-win64-x64.zip' + +# install: +# - ps: | +# if (!(Test-Path LLVM-5.0.1-win64.exe)) { +# appveyor DownloadFile https://releases.llvm.org/5.0.1/LLVM-5.0.1-win64.exe +# } +# scripts\check-sha256.ps1 LLVM-5.0.1-win64.exe 981543611D719624ACB29A2CFFD6A479CFF36E8AB5EE8A57D8ECA4F9C4C6956F +# Start-Process -FilePath 'LLVM-5.0.1-win64.exe' -ArgumentList '/S','/D=C:\LLVM-5.0.1' -Wait +# - ps: | +# if (!(Test-Path cmake-3.10.1-win64-x64.zip)) { +# appveyor DownloadFile https://cmake.org/files/v3.10/cmake-3.10.1-win64-x64.zip +# } +# scripts\check-sha256.ps1 cmake-3.10.1-win64-x64.zip 8251F70C85B58F3CA1F24E4A3B0637E2D609B5E4A341D00B70E02E89244D5029 +# Start-Process -FilePath '7z' -ArgumentList 'x','cmake-3.10.1-win64-x64.zip','-oC:\' -Wait + +# before_build: +# - set PATH=C:\LLVM-5.0.1\msbuild-bin;%PATH% +# - set PATH=C:\cmake-3.10.1-win64-x64\bin;%PATH% +# - set QT_CMAKE=C:\Qt\5.7\msvc2015_64\lib\cmake +# - mkdir %APPVEYOR_BUILD_FOLDER%\build +# - cd %APPVEYOR_BUILD_FOLDER%\build + +# build_script: +# - cmake -G "Visual Studio 14 2015 Win64" -T LLVM-vs2014 -DMBGL_PLATFORM=qt -DWITH_QT_DECODERS=ON -DWITH_QT_I18N=ON -DWITH_NODEJS=OFF -DCMAKE_PREFIX_PATH=%QT_CMAKE% %APPVEYOR_BUILD_FOLDER% & exit 0 +# - cmake --build . --config Release --target qmapboxgl -- /m + +# after_build: +# - mkdir qmapboxgl +# - mkdir qmapboxgl\lib +# - mkdir qmapboxgl\include +# - copy Release\qmapboxgl.* qmapboxgl\lib +# - copy %APPVEYOR_BUILD_FOLDER%\platform\qt\include\* qmapboxgl\include +# - 7z a qmapboxgl-%APPVEYOR_REPO_COMMIT%.zip qmapboxgl + +# artifacts: +# - path: build\qmapboxgl-%APPVEYOR_REPO_COMMIT%.zip +# name: QMapboxGL + +# test: off diff --git a/circle.yml b/circle.yml index 3378eb18ae..c37e43c2bb 100644 --- a/circle.yml +++ b/circle.yml @@ -8,41 +8,41 @@ workflows: filters: branches: ignore: master - - android-debug-arm-v7 - - android-release-all - - node4-clang39-release: - filters: - tags: - only: /node-.*/ - - node6-clang39-release: - filters: - tags: - only: /node-.*/ - - node6-gcc6-debug: - filters: - tags: - only: /node-.*/ - - linux-clang-3.8-libcxx-debug - - linux-clang4-sanitize-address - - linux-clang4-sanitize-undefined - - linux-clang4-sanitize-thread - - linux-gcc4.9-debug - - linux-gcc5-debug-coverage - - linux-gcc5-release-qt4 - - linux-gcc5-release-qt5 - - ios-debug - #- ios-sanitize-address - - ios-sanitize-thread - - macos-debug - - macos-debug-qt5 - - macos-release-node4: - filters: - tags: - only: /node-.*/ - - macos-release-node6: - filters: - tags: - only: /node-.*/ + # - android-debug-arm-v7 + # - android-release-all + # - node4-clang39-release: + # filters: + # tags: + # only: /node-.*/ + # - node6-clang39-release: + # filters: + # tags: + # only: /node-.*/ + # - node6-gcc6-debug: + # filters: + # tags: + # only: /node-.*/ + # - linux-clang-3.8-libcxx-debug + # - linux-clang4-sanitize-address + # - linux-clang4-sanitize-undefined + # - linux-clang4-sanitize-thread + # - linux-gcc4.9-debug + # - linux-gcc5-debug-coverage + # - linux-gcc5-release-qt4 + # - linux-gcc5-release-qt5 + # - ios-debug + # #- ios-sanitize-address + # - ios-sanitize-thread + # - macos-debug + # - macos-debug-qt5 + # - macos-release-node4: + # filters: + # tags: + # only: /node-.*/ + # - macos-release-node6: + # filters: + # tags: + # only: /node-.*/ step-library: - &generate-cache-key diff --git a/dangerfile.js b/dangerfile.js new file mode 100644 index 0000000000..655b12ec71 --- /dev/null +++ b/dangerfile.js @@ -0,0 +1,15 @@ +// Import the feedback functions +import { message, warn, fail, markdown } from "danger" + +const child_process = require('child_process'); + +// Make sure that the mapbox-gl-js submodule pin is up to date +const submodulePinsToMaster = child_process.execSync('git -C mapbox-gl-js branch -a --contains `git -C mapbox-gl-js rev-parse HEAD`').toString().split('\n').indexOf(' remotes/origin/master') >= 0; +if (!submodulePinsToMaster) { + fail(`mapbox-gl-js submodule pin is not yet merged to master`); +} + +const coreFileDiff = child_process.execSync('scripts/generate-core-files.sh').toString(); +if (coreFileDiff != '') { + fail(`Please run scripts/generate-core-files.sh:
${coreFileDiff}
`) +} diff --git a/package.json b/package.json index 4ff4b32735..0260c786d7 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "pixelmatch": "^4.0.2", "pngjs": "^3.0.0", "request": "^2.72.0", + "danger": "^3.0.3", "tape": "^4.5.1" }, "engines": { @@ -37,6 +38,7 @@ "scripts": { "preinstall": "npm install node-pre-gyp", "install": "node-pre-gyp install --fallback-to-build=false || make node", + "danger-ci": "danger ci", "test": "tape platform/node/test/js/**/*.test.js", "test-memory": "node --expose-gc platform/node/test/memory.test.js", "test-suite": "run-s test-render test-query test-expressions", -- cgit v1.2.1