Ver código fonte

For CI - adjust the timestamp to achieve incremental build on AppVeyor.
[ci only: master, MinGW]

Yao Wei Tjong 姚伟忠 8 anos atrás
pai
commit
a9973de026
3 arquivos alterados com 12 adições e 6 exclusões
  1. 2 1
      .appveyor.yml
  2. 2 3
      .travis.yml
  3. 8 2
      Rakefile

+ 2 - 1
.appveyor.yml

@@ -27,6 +27,7 @@ platform:
 clone_depth: 50
 cache:
   - Build
+  - mingw-Build
 environment:
   GIT_NAME:
     secure: onlJNy/nGFT1GXNdusL4jokojSPZ732EFaXwdhPnpM0=
@@ -64,7 +65,7 @@ before_build:
   - ps: $env:COMMIT_MESSAGE = $(git log --format=%B -n 1 $env:APPVEYOR_REPO_COMMIT)
   - rake ci_setup_cache
 build_script:
-  - rake ci && if "%PACKAGE_UPLOAD%" == "1" rake ci_package_upload && move Build\*.zip . && rd /S /Q Build\_CPack_Packages
+  - rake ci && if "%PACKAGE_UPLOAD%" == "1" rake ci_package_upload && move %build_tree%\*.zip . && rd /S /Q %build_tree%\_CPack_Packages
   - rake ci_timer
 after_build: rake ci_teardown_cache
 test: off

+ 2 - 3
.travis.yml

@@ -133,8 +133,7 @@ platform:
   - x64
 clone_depth: 50
 cache:
-  - C:\tools\mingw32 -> .appveyor.yml
-  - C:\tools\mingw64 -> .appveyor.yml
+  - Build
   - mingw-Build
 environment:
   GIT_NAME:
@@ -172,7 +171,7 @@ install:
           iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-desktop.ps1'))
         }
   - if "%PLATFORM%" == "x64" (set "URHO3D_64BIT=1" && set "MINGW_URL=%x86_64-posix-seh%" && set "ARCH=64") else (set "MINGW_URL=%i686-posix-dwarf%" && set "ARCH=32")
-  - if not exist "C:\tools\mingw%ARCH%" curl -fsSL -o "mingw.7z" -O "%MINGW_URL%" && 7z x -y -o"C:\tools" "mingw.7z" >nul && echo "Installed MinGW compiler toolchain to C:\tools"
+  - curl -fsSL -o "mingw.7z" -O "%MINGW_URL%" && 7z x -y -o"C:\tools" "mingw.7z" >nul && echo "Installed MinGW compiler toolchain to C:\tools"
   - set "PATH=C:\tools\mingw%ARCH%\bin;%PATH%"
 before_build:
   - set "APPVEYOR_REPO_COMMIT=%APPVEYOR_REPO_COMMIT%~"

+ 8 - 2
Rakefile

@@ -400,7 +400,7 @@ task :ci do
     # Second test - create a new project on the fly that uses newly built Urho3D library in the build tree
     Dir.chdir scaffolding "#{ENV['APPVEYOR'] ? '' : '../Build/'}UsingBuildTree" do
       puts "Configuring downstream project using Urho3D library in its build tree...\n\n"; $stdout.flush
-      system "rake cmake #{generator} URHO3D_HOME=#{ENV['APPVEYOR'] ? '../../Build' : '..'} URHO3D_LUA=1 && rake make #{test}" or abort 'Failed to configure/build/test temporary downstream project using Urho3D as external library'
+      system "rake cmake #{generator} URHO3D_HOME=#{ENV['APPVEYOR'] ? "../../#{ENV['build_tree']}" : '..'} URHO3D_LUA=1 && rake make #{test}" or abort 'Failed to configure/build/test temporary downstream project using Urho3D as external library'
     end
   end
   # Make, deploy, and test run Android APK in an Android (virtual) device
@@ -425,6 +425,10 @@ task :ci_setup_cache do
   # AppVeyor on Windows host has different kind of cache mechanism, not based on ccache
   if ENV['APPVEYOR']
     system "bash -c 'rm -rf #{ENV['build_tree']}'" if clear
+    if File.exists?("#{ENV['build_tree']}/.commit")
+      last_commit = File.read "#{ENV['build_tree']}/.commit"
+      system "bash -c 'find CMakeLists.txt CMake Docs Source |xargs touch -r #{ENV['build_tree']}/CMakeCache.txt' && touch $(git diff --name-only #{last_commit} #{ENV['APPVEYOR_REPO_COMMIT']})"
+    end
     next
   # Use internal cache store instead of using Travis CI one (this is a workaround for using ccache on Travis CI legacy build infra)
   elsif ENV['USE_CCACHE'].to_i == 2
@@ -449,7 +453,9 @@ desc 'Teardown build cache'
 task :ci_teardown_cache do
   # AppVeyor on Windows host has different kind of cache mechanism, not based on ccache
   if ENV['APPVEYOR']
-    # No-op for now
+    File.write("#{ENV['build_tree']}/.commit", ENV['APPVEYOR_REPO_COMMIT']) if Dir.exist?(ENV['build_tree'])
+    # Temporarily exclude build artifacts from being cached due to cache size limitation
+    system "bash -c 'rm #{ENV['build_tree']}/bin/*.{exe,dll}'"
     next
   # Upload cache to internal cache store if it is our own
   elsif ENV['USE_CCACHE'].to_i == 2