Skip to content

Commit

Permalink
Integration of code parts from #177 provided by @KangLin to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ftylitak committed May 6, 2021
1 parent d48a139 commit 3431715
Show file tree
Hide file tree
Showing 5 changed files with 297 additions and 127 deletions.
32 changes: 19 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#Author: KangLin([email protected])

#sudo: required
dist: xenial
dist: bionic

services:
- xvfb

language: cpp

cache:
- apt: true
- apt
- directories:
- Tools
- Package

compiler:
- g++
Expand All @@ -24,17 +24,15 @@ addons:

env:
jobs:
- BUILD_TARGERT="linux" QT_VERSION_DIR=5.13 QT_VERSION=5.13.0
# - BUILD_TARGERT="android_armv7" QT_VERSION_DIR=5.13 QT_VERSION=5.13.0
- BUILD_TARGERT="linux" QT_VERSION_DIR=5.12 QT_VERSION=5.12.4
# - BUILD_TARGERT="android_armv7" QT_VERSION_DIR=5.12 QT_VERSION=5.12.4
- BUILD_TARGERT="linux" QT_VERSION_DIR=5.9 QT_VERSION=5.9.8
# - BUILD_TARGERT="android_armv7" QT_VERSION_DIR=5.9 QT_VERSION=5.9.8
- BUILD_TARGERT="unix" DOWNLOAD_QT=APT
- BUILD_TARGERT="unix" QT_VERSION_DIR=512 QT_VERSION=5.12.6 DOWNLOAD_QT=FALSE
- BUILD_TARGERT="unix" QT_VERSION_DIR=511 QT_VERSION=5.11.3 DOWNLOAD_QT=FALSE

before_install:
- echo "TRAVIS_OS_NAME=${TRAVIS_OS_NAME}"
- export DISPLAY=:99.0
- sudo apt-get install -y libgl1-mesa-glx libgl1-mesa-dev
- cmake --version

install:
- bash ${TRAVIS_BUILD_DIR}/ci/build-install-tools.sh #> /dev/null
Expand All @@ -43,7 +41,15 @@ before_script:
- source ${TRAVIS_BUILD_DIR}/ci/build_env.sh

script:
- mkdir ${TRAVIS_BUILD_DIR}/build
- cd ${TRAVIS_BUILD_DIR}/build
- ${QT_ROOT}/bin/qmake -o Makefile CONFIG+=Release ${TRAVIS_BUILD_DIR}/src/QZXing.pro
- make -f Makefile
# Test qmake
- mkdir ${TRAVIS_BUILD_DIR}/build_qamke
- cd ${TRAVIS_BUILD_DIR}/build_qamke
- ${QT_ROOT}/bin/qmake CONFIG+=Release PRFIEX=`pwd`/install ${TRAVIS_BUILD_DIR}/src
- make install

# Test cmake (deactivated for now)
# - mkdir ${TRAVIS_BUILD_DIR}/build_camke
# - cd ${TRAVIS_BUILD_DIR}/build_camke
# - cmake -DQt5_DIR=${QT_ROOT}/lib/cmake/Qt5 -DCMAKE_INSTALL_PREFIX=`pwd`/install ${TRAVIS_BUILD_DIR}/src
# - cmake --build . --config Release
# - cmake --build . --config Release --target install
128 changes: 65 additions & 63 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,91 +1,93 @@
#original author: KangLin([email protected])
#original author: Kang Lin([email protected])

version: '3.0.a.5.{build}'
version: "3.0.a.5.{build}"

configuration:
- release
- debug
- Release
- Debug

environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
QT_ROOT: C:/Qt/5.12/msvc2017_64
# - QT_ROOT: C:/Qt/5.12/msvc2015
# - QT_ROOT: C:/Qt/5.12/mingw53_32

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
QT_ROOT: C:/Qt/5.9/msvc2017_64
# - QT_ROOT: C:/Qt/5.9/msvc2015_64
# - QT_ROOT: C:/Qt/5.9/msvc2015
# - QT_ROOT: C:/Qt/5.9/msvc2013_64
# - QT_ROOT: C:/Qt/5.9/mingw53_32

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
QT_ROOT: C:/Qt/5.6/msvc2015_64
# - QT_ROOT: C:/Qt/5.6/msvc2015
# - QT_ROOT: C:/Qt/5.6/msvc2013_64
# - QT_ROOT: C:/Qt/5.6/msvc2013

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
GENERATORS: "Visual Studio 14 2015"
QT_ROOT: C:/Qt/5.6/msvc2015

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
GENERATORS: "Visual Studio 14 2015 Win64"
QT_ROOT: C:/Qt/5.9/msvc2015_64

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
GENERATORS: "Visual Studio 15 2017 Win64"
QT_ROOT: C:/Qt/5.12/msvc2017_64

init:

install:
- for /f "delims=" %%i in ('git describe --tags') do (set BUILD_VERSION=%%i)
- if "%BUILD_VERSION%" == "" for /f "delims=" %%i in ('git rev-parse HEAD') do (set BUILD_VERSION=%%i)
- if "%BUILD_VERSION%" == "" for /f "delims=" %%i in ('git rev-parse HEAD') do (set BUILD_VERSION=%%i)
- echo BUILD_VERSION=%BUILD_VERSION%
- if NOT "%QT_ROOT%" == "NO" for /f "delims=" %%i in ('%QT_ROOT%/bin/qmake -query QT_VERSION') do (set QT_VERSION=%%i)
- echo "QT_VERSION:%QT_VERSION"
- if NOT "%QT_ROOT%" == "NO" for /f "delims=" %%i in ('%QT_ROOT%/bin/qmake -query QMAKE_XSPEC') do (set QMAKE_XSPEC=%%i)
- echo "QMAKE_XSPEC=%QMAKE_XSPEC%"
- set TOOLCHAIN_VERSION=""
- ps: >-
if (($env:QMAKE_XSPEC).Contains("msvc"))
{
$env:MAKE="nmake"
if (($env:QT_ROOT).Contains("_64"))
{
$env:varch="amd64"
}
else
{
$env:varch="x86"
}
if (($env:QT_ROOT).Contains("2017"))
{
$env:TOOLCHAIN_VERSION="15"
}
else
{
if (($env:QT_ROOT).Contains("2015"))
{
$env:TOOLCHAIN_VERSION="14"
}elseif (($env:QT_ROOT).Contains("2013"))
{
$env:TOOLCHAIN_VERSION="12"
}
}
}
else
{
$env:MAKE="mingw32-make"
$env:PATH="C:\Qt\Tools\mingw530_32;$env:PATH"
}
if (($env:QMAKE_XSPEC).Contains("msvc"))
{
$env:MAKE="nmake"
if (($env:QT_ROOT).Contains("_64"))
{
$env:varch="amd64"
}
else
{
$env:varch="x86"
}
if (($env:QT_ROOT).Contains("2017"))
{
$env:TOOLCHAIN_VERSION="15"
}
else
{
if (($env:QT_ROOT).Contains("2015"))
{
$env:TOOLCHAIN_VERSION="14"
}elseif (($env:QT_ROOT).Contains("2013"))
{
$env:TOOLCHAIN_VERSION="12"
}
}
}
else
{
$env:MAKE="mingw32-make"
$env:PATH="C:\Qt\Tools\mingw530_32;$env:PATH"
}
- if NOT "%TOOLCHAIN_VERSION%"=="" if %TOOLCHAIN_VERSION% LSS 15 (call "C:/Program Files (x86)/Microsoft Visual Studio %TOOLCHAIN_VERSION%.0/VC/vcvarsall.bat" %varch%) else (call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat" %varch%)
- echo "cl "
- cl

build_script:
- mkdir "%APPVEYOR_BUILD_FOLDER%/build"
- cd "%APPVEYOR_BUILD_FOLDER%/build"
- call "%QT_ROOT%/bin/qmake.exe" CONFIG+=%Configuration% PREFIX="%APPVEYOR_BUILD_FOLDER%/install" "%APPVEYOR_BUILD_FOLDER%/src/QZXing.pro"
# Test qmake
- mkdir "%APPVEYOR_BUILD_FOLDER%/build_qmake"
- cd "%APPVEYOR_BUILD_FOLDER%/build_qmake"
- call "%QT_ROOT%/bin/qmake.exe" CONFIG+=%Configuration% PREFIX="%APPVEYOR_BUILD_FOLDER%/install_qmake" "%APPVEYOR_BUILD_FOLDER%/src"
- call %MAKE%
- call %MAKE% install
- call %MAKE% install

# Test cmake (deactivated for now)
# - mkdir "%APPVEYOR_BUILD_FOLDER%/build_cmake"
# - cd "%APPVEYOR_BUILD_FOLDER%/build_cmake"
# - cmake.exe -G"%GENERATORS%" -DCMAKE_INSTALL_PREFIX="%APPVEYOR_BUILD_FOLDER%/install_cmake" -DQt5_DIR="%QT_ROOT%/lib/cmake/Qt5" "%APPVEYOR_BUILD_FOLDER%/src"
# - cmake --build . --config %Configuration%
# - cmake --build . --config %Configuration% --target install

test_script:

artifacts:
- path: install
name: QZXing_$(QMAKE_XSPEC)$(TOOLCHAIN_VERSION)_$(CONFIGURATION)_$(BUILD_VERSION)
- path: install_qmake
name: QZXing_$(QMAKE_XSPEC)$(TOOLCHAIN_VERSION)_$(CONFIGURATION)_Qt$(QT_VERSION)_$(BUILD_VERSION)
type: zip

# whitelist branches to avoid testing feature branches twice (as branch and as pull request)
Expand All @@ -97,6 +99,6 @@ deploy:
provider: GitHub
#token: https://github.com/settings/tokens encode token: https://ci.appveyor.com/tools/encrypt
auth_token:
secure: #TODO: set your token
secure: #TODO: set your token
on:
appveyor_repo_tag: true # deploy on tag push only
appveyor_repo_tag: true # deploy on tag push only
Loading

0 comments on commit 3431715

Please sign in to comment.