Skip to content
This repository was archived by the owner on Mar 4, 2023. It is now read-only.

Commit 002a13b

Browse files
committed
added CI
1 parent f563632 commit 002a13b

File tree

12 files changed

+184
-7
lines changed

12 files changed

+184
-7
lines changed

.travis.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
language: cpp
2+
3+
services:
4+
- docker
5+
6+
sudo: required
7+
dist: trusty
8+
osx_image: xcode8.3
9+
10+
env:
11+
global:
12+
- QT_VER=5.9.1
13+
- PROJECT=QtRestClient
14+
- EXTRA_MODULES=.skycoder42.jsonserializer
15+
16+
matrix:
17+
include:
18+
- os: linux
19+
env:
20+
- PLATFORM=gcc_64
21+
- BUILD_DOC=true
22+
- os: linux
23+
env:
24+
- PLATFORM=android_armv7
25+
- os: linux
26+
env:
27+
- PLATFORM=android_x86
28+
- os: osx
29+
env:
30+
- PLATFORM=clang_64
31+
- os: osx
32+
env:
33+
- PLATFORM=ios
34+
35+
before_install:
36+
- git clone https://github.com/Skycoder42/QtModules.git ./qtmodules-travis
37+
- ./tests/ci/setup.sh
38+
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then travis_wait 40 ./qtmodules-travis/ci/$TRAVIS_OS_NAME/setup.sh; else ./qtmodules-travis/ci/$TRAVIS_OS_NAME/setup.sh; fi
39+
40+
script:
41+
- ./qtmodules-travis/ci/$TRAVIS_OS_NAME/build.sh
42+
43+
before_deploy:
44+
- ./qtmodules-travis/ci/$TRAVIS_OS_NAME/upload-prepare.sh
45+
deploy:
46+
provider: releases
47+
skip_cleanup: true
48+
api_key:
49+
secure: juYFBTtn/vpb/c4WthQIeAqWqeW0zrg2Sl7BeEj7Udi8NQoWafrMGq8xSGfodkbK1yugxGFYQ6u1UOKoK4M2JHuDzHnNCRBwgJ9X89RlmRISALUnTXQRketdyo2ydy89sVEdppG9v2eXyC4R599GmE/I49jLkXLvED1j8uSLhZNDR2OYUH+no0gpnULnbHCZtwBr4wRYi1tH0hPf3xeoDFX5Tgz4yVgyX9+paBJln+Ate5CzlGyuT8AD4Sw+zRAixh6uUlFj90cXIc/JzJkHvPRoHy73TwauFurq2CaPc+UyIgQhISUZyArFi/mMpc1FVkBrKrb5eu1FmUiOkQtbIiMW51yGD8bW+N10oR2TJQU1/tyk4TLGvSISAx5Op07Q665w/qIQsbV6TNZxsNarWFI1VgOn49NOglc8dxeYAoE1IGKc+fbupYgQUcDKfrOx0/kRmc2VkBmPANh4FNAkREBQkvFGoEmHvhuBMs/eCDYWz/mu3ORQqmWZK415JWukgwxeuz0c1GWEPSx8S+L20K+iCZH3+kByerFPDc5185V0M90o9DzK0UNXhH+TGfP4cozrv43L/tTRAwaJTyVguj6p/+CRwifpLVOashcmer6JkDXVPqf+q8z588LLWDTuficj4rY95Cd+WxqBy5j97//5L4ckYqkDfTB7vE4d5cI=
50+
file_glob: true
51+
file: install/opt/build_*_$QT_VER.tar.xz
52+
on:
53+
repo: Skycoder42/QtRestClient
54+
tags: true
55+
56+
before_cache:
57+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
58+
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
59+
cache:
60+
directories:
61+
- $HOME/.gradle/caches/
62+
- $HOME/.gradle/wrapper/
63+
- $HOME/.android/build-cache

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# QtRestClient
22
A library for generic JSON-based REST-APIs, with a mechanism to map JSON to Qt objects.
33

4+
[![Travis Build Status](https://travis-ci.org/Skycoder42/QtRestClient.svg?branch=master)](https://travis-ci.org/Skycoder42/QtRestClient)
5+
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/66vntcoho3t4x1jw?svg=true)](https://ci.appveyor.com/project/Skycoder42/qtrestclient)
6+
47
## Features
58
- Consume any JSON-REST-API
69
- Map API objects to QObject/Q_GADGET classes. Supports:

appveyor.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
image:
2+
- Visual Studio 2017
3+
- Visual Studio 2015
4+
5+
version: build-{build}
6+
7+
environment:
8+
QT_VER: 5.9.1
9+
PROJECT: QtRestClient
10+
EXTRA_MODULES: .skycoder42.jsonserializer
11+
12+
matrix:
13+
- PLATFORM: msvc2017_64
14+
- PLATFORM: winrt_x64_msvc2017
15+
- PLATFORM: winrt_x86_msvc2017
16+
- PLATFORM: winrt_armv7_msvc2017
17+
- PLATFORM: msvc2015_64
18+
- PLATFORM: msvc2015
19+
- PLATFORM: mingw53_32
20+
21+
matrix:
22+
exclude:
23+
- PLATFORM: msvc2017_64
24+
image: Visual Studio 2015
25+
- PLATFORM: winrt_x64_msvc2017
26+
image: Visual Studio 2015
27+
- PLATFORM: winrt_x86_msvc2017
28+
image: Visual Studio 2015
29+
- PLATFORM: winrt_armv7_msvc2017
30+
image: Visual Studio 2015
31+
- PLATFORM: mingw53_32
32+
image: Visual Studio 2015
33+
- PLATFORM: msvc2015_64
34+
image: Visual Studio 2017
35+
- PLATFORM: msvc2015
36+
image: Visual Studio 2017
37+
38+
install:
39+
- git clone https://github.com/Skycoder42/QtModules.git .\qtmodules-travis
40+
- npm install -g json-server
41+
- .\qtmodules-travis\ci\win\setup.bat
42+
43+
build_script:
44+
- .\tests\ci\build.bat
45+
46+
after_build:
47+
- .\qtmodules-travis\ci\win\upload-prepare.bat
48+
49+
artifacts:
50+
- path: install\build_*_%QT_VER%.zip
51+
52+
deploy:
53+
provider: GitHub
54+
auth_token:
55+
secure: Cp5GRQku2ZWnKPE12NB5q11ZO0Fr5mlzdUTjnLpYJr/dki4LPVqm231edFggogy8
56+
artifact: /.*\.zip/
57+
force_update: true
58+
on:
59+
appveyor_repo_tag: true

doc/makedoc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ doxyTemplate="$srcDir/Doxyfile"
1919
readme="$destDir/README.md"
2020
doxme="$scriptDir/doxme.py"
2121

22-
python "$doxme" "$srcDir/../README.md"
22+
python3 "$doxme" "$srcDir/../README.md"
2323

2424
cat "$doxyTemplate" > Doxyfile
2525
echo "PROJECT_NUMBER = \"$version\"" >> Doxyfile

tests/auto/restclient/jphpost.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ bool JphPost::equals(const JphPost *left, const QObject *right)
2828

2929
bool JphPost::equals(const QObject *other) const
3030
{
31-
3231
if(this == other)
3332
return true;
3433
else if(!other)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
json-server --port 3000 --host 127.0.0.1 --no-gzip --watch test-rest-db.json
1+
start /b cmd /c json-server --port 3000 --host 127.0.0.1 --no-gzip --watch "%~dp0\test-rest-db.json" || exit \B 1
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/bin/bash
2-
json-server --port 3000 --host 127.0.0.1 --no-gzip --watch test-rest-db.json
3-
2+
set -e
3+
4+
json-server --port 3000 --host 127.0.0.1 --no-gzip --watch "$(dirname "$0")/test-rest-db.json" &

tests/auto/restclient/tests.pri

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ DISTFILES += \
1414
$$PWD/rest-db-setup.bat \
1515
$$PWD/default-test-db.js \
1616
$$PWD/advanced-test-db.js \
17-
$$PWD/build-test-db.js
17+
$$PWD/build-test-db.js \
18+
$$PWD/rest-db-setup.sh
1819

1920
DEFINES += "TEST_SRC_DIR=\\\"$$PWD\\\""
2021

tests/auto/restclient/tst_global.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void initTestJsonServer(QString relativeDbPath)
2525

2626
inFile.close();
2727
outFile.close();
28-
QThread::msleep(500);//Time for the server to reload the database
28+
QThread::sleep(2);//Time for the server to reload the database
2929
}
3030

3131
QtRestClient::RestClient *createClient(QObject *parent)

tests/ci/build.bat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
call .\tests\auto\restclient\rest-db-setup.bat || (
2+
taskkill /F /IM node.exe
3+
exit /B 1
4+
)
5+
6+
call .\qtmodules-travis\ci\win\build.bat || (
7+
taskkill /F /IM node.exe
8+
exit /B 1
9+
)
10+
11+
taskkill /F /IM node.exe

0 commit comments

Comments
 (0)