fix conditions

This commit is contained in:
Denis S. Soldatov aka General-Beck 2018-01-10 07:33:46 +03:00
parent cb8c4b4e96
commit 0b91bd4b11
3 changed files with 39 additions and 39 deletions

View File

@ -26,7 +26,7 @@ linux-stable:
script: script:
- rustup default stable - rustup default stable
# ARGUMENTS: 1. BUILD_PLATFORM (target for binaries) 2. PLATFORM (target for cargo) 3. ARC (architecture) 4. & 5. CC & CXX flags # ARGUMENTS: 1. BUILD_PLATFORM (target for binaries) 2. PLATFORM (target for cargo) 3. ARC (architecture) 4. & 5. CC & CXX flags
- sh scripts/gitlab-build.sh x86_64-unknown-linux-gnu x86_64-unknown-linux-gnu amd64 - scripts/gitlab-build.sh x86_64-unknown-linux-gnu x86_64-unknown-linux-gnu amd64 "" ""
tags: tags:
- rust-stable - rust-stable
artifacts: artifacts:
@ -43,7 +43,7 @@ linux-stable-debian:
- triggers - triggers
script: script:
- export LIBSSL="libssl1.1.0 (>=1.1.0)" - export LIBSSL="libssl1.1.0 (>=1.1.0)"
- sh scripts/gitlab-build.sh x86_64-unknown-debian-gnu x86_64-unknown-linux-gnu amd64 - scripts/gitlab-build.sh x86_64-unknown-debian-gnu x86_64-unknown-linux-gnu amd64 "" ""
tags: tags:
- rust-debian - rust-debian
artifacts: artifacts:
@ -59,7 +59,7 @@ linux-beta:
- stable - stable
- triggers - triggers
script: script:
- sh scripts/gitlab-build.sh rust-beta x86_64-unknown-linux-gnu - scripts/gitlab-build.sh rust-beta x86_64-unknown-linux-gnu "" "" ""
tags: tags:
- rust-beta - rust-beta
artifacts: artifacts:
@ -76,7 +76,7 @@ linux-nightly:
- stable - stable
- triggers - triggers
script: script:
- sh scripts/gitlab-build.sh rust-nightly x86_64-unknown-linux-gnu - scripts/gitlab-build.sh rust-nightly x86_64-unknown-linux-gnu "" "" ""
tags: tags:
- rust-nightly - rust-nightly
artifacts: artifacts:
@ -93,7 +93,7 @@ linux-centos:
- stable - stable
- triggers - triggers
script: script:
- sh scripts/gitlab-build.sh x86_64-unknown-centos-gnu x86_64-unknown-linux-gnu - scripts/gitlab-build.sh x86_64-unknown-centos-gnu x86_64-unknown-linux-gnu "" "" ""
tags: tags:
- rust-centos - rust-centos
artifacts: artifacts:
@ -109,7 +109,7 @@ linux-i686:
- stable - stable
- triggers - triggers
script: script:
- sh scripts/gitlab-build.sh i686-unknown-linux-gnu i686-unknown-linux-gnu i386 - scripts/gitlab-build.sh i686-unknown-linux-gnu i686-unknown-linux-gnu i386 "" ""
tags: tags:
- rust-i686 - rust-i686
artifacts: artifacts:
@ -125,7 +125,7 @@ linux-armv7:
- stable - stable
- triggers - triggers
script: script:
- sh scripts/gitlab-build.sh armv7-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf armhf arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++ - scripts/gitlab-build.sh armv7-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf armhf arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++
tags: tags:
- rust-arm - rust-arm
artifacts: artifacts:
@ -141,7 +141,7 @@ linux-arm:
- stable - stable
- triggers - triggers
script: script:
- sh scripts/gitlab-build.sh arm-unknown-linux-gnueabihf arm-unknown-linux-gnueabihf armhf arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++ - scripts/gitlab-build.sh arm-unknown-linux-gnueabihf arm-unknown-linux-gnueabihf armhf arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++
tags: tags:
- rust-arm - rust-arm
artifacts: artifacts:
@ -157,7 +157,7 @@ linux-aarch64:
- stable - stable
- triggers - triggers
script: script:
- sh scripts/gitlab-build.sh aarch64-unknown-linux-gnu aarch64-unknown-linux-gnu arm64 aarch64-linux-gnu-gcc aarch64-linux-gnu-g++ - scripts/gitlab-build.sh aarch64-unknown-linux-gnu aarch64-unknown-linux-gnu arm64 aarch64-linux-gnu-gcc aarch64-linux-gnu-g++
tags: tags:
- rust-arm - rust-arm
artifacts: artifacts:
@ -174,7 +174,7 @@ linux-snap:
- tags - tags
- triggers - triggers
script: script:
- sh scripts/gitlab-build.sh x86_64-unknown-snap-gnu - scripts/gitlab-build.sh x86_64-unknown-snap-gnu "" "" "" ""
tags: tags:
- rust-stable - rust-stable
artifacts: artifacts:
@ -190,7 +190,7 @@ darwin:
- stable - stable
- triggers - triggers
script: script:
- sh scripts/gitlab-build.sh x86_64-apple-darwin x86_64-apple-darwin macos - scripts/gitlab-build.sh x86_64-apple-darwin x86_64-apple-darwin macos "" ""
tags: tags:
- osx - osx
artifacts: artifacts:
@ -208,7 +208,7 @@ windows:
- stable - stable
- triggers - triggers
script: script:
- scripts/gitlab-build.sh x86_64-pc-windows-msvc - scripts/gitlab-build.sh x86_64-pc-windows-msvc "" "" "" "" ""
tags: tags:
- rust-windows - rust-windows
artifacts: artifacts:
@ -227,7 +227,7 @@ docker-build:
- if [ "$CI_BUILD_REF_NAME" == "beta-release" ]; then DOCKER_TAG="latest"; else DOCKER_TAG=$CI_BUILD_REF_NAME; fi - if [ "$CI_BUILD_REF_NAME" == "beta-release" ]; then DOCKER_TAG="latest"; else DOCKER_TAG=$CI_BUILD_REF_NAME; fi
- echo "Tag:" $DOCKER_TAG - echo "Tag:" $DOCKER_TAG
- docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity - docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity
- sh scripts/docker-build.sh $DOCKER_TAG - scripts/docker-build.sh $DOCKER_TAG
- docker logout - docker logout
tags: tags:
- docker - docker
@ -236,7 +236,7 @@ test-coverage:
only: only:
- master - master
script: script:
- sh scripts/gitlab-test.sh test-coverage - scripts/gitlab-test.sh test-coverage
tags: tags:
- kcov - kcov
allow_failure: true allow_failure: true
@ -244,7 +244,7 @@ test-rust-stable:
stage: test stage: test
image: parity/rust:gitlab-ci image: parity/rust:gitlab-ci
script: script:
- sh scripts/gitlab-test.sh stable - scripts/gitlab-test.sh stable
tags: tags:
- rust-stable - rust-stable
test-rust-beta: test-rust-beta:
@ -254,7 +254,7 @@ test-rust-beta:
- master - master
image: parity/rust:gitlab-ci image: parity/rust:gitlab-ci
script: script:
- sh scripts/gitlab-test.sh beta - scripts/gitlab-test.sh beta
tags: tags:
- rust-beta - rust-beta
allow_failure: true allow_failure: true
@ -265,7 +265,7 @@ test-rust-nightly:
- master - master
image: parity/rust:gitlab-ci image: parity/rust:gitlab-ci
script: script:
- sh scripts/gitlab-test.sh nightly - scripts/gitlab-test.sh nightly
tags: tags:
- rust - rust
- rust-nightly - rust-nightly
@ -274,7 +274,7 @@ js-test:
stage: test stage: test
image: parity/rust:gitlab-ci image: parity/rust:gitlab-ci
script: script:
- sh scripts/gitlab-test.sh js-test - scripts/gitlab-test.sh js-test
tags: tags:
- rust-stable - rust-stable
js-release: js-release:
@ -287,7 +287,7 @@ js-release:
- triggers - triggers
image: parity/rust:gitlab-ci image: parity/rust:gitlab-ci
script: script:
- sh scripts/gitlab-test.sh js-release - scripts/gitlab-test.sh js-release
tags: tags:
- javascript - javascript
push-release: push-release:

2
scripts/gitlab-build.sh Normal file → Executable file
View File

@ -9,7 +9,7 @@ ARC=$3
CC=$4 CC=$4
CXX=$5 CXX=$5
EXT=deb EXT=deb
VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n") VER="$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")"
echo "--------------------" echo "--------------------"
echo "Build for platform: " $BUILD_PLATFORM echo "Build for platform: " $BUILD_PLATFORM
echo "Cargo target: " $PLATFORM echo "Cargo target: " $PLATFORM

36
scripts/gitlab-test.sh Normal file → Executable file
View File

@ -2,17 +2,17 @@
#ARGUMENT test for RUST, JS, COVERAGE or JS_RELEASE #ARGUMENT test for RUST, JS, COVERAGE or JS_RELEASE
set -e # fail on any error set -e # fail on any error
set -u # treat unset variables as error set -u # treat unset variables as error
export JS_FILES_MODIFIED=$(git --no-pager diff --name-only master...$CI_BUILD_REF | grep ^js/ | wc -l) export JS_FILES_MODIFIED="$(git --no-pager diff --name-only master...$CI_BUILD_REF | grep ^js/ | wc -l)"
export JS_OLD_FILES_MODIFIED=$(git --no-pager diff --name-only master...$CI_BUILD_REF | grep ^js-old/ | wc -l) export JS_OLD_FILES_MODIFIED="$(git --no-pager diff --name-only master...$CI_BUILD_REF | grep ^js-old/ | wc -l)"
export RUST_FILES_MODIFIED=$(git --no-pager diff --name-only master...$CI_BUILD_REF | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^test.sh -e ^windows/ -e ^scripts/ -e^mac/ -e ^nsis/ | wc -l) export RUST_FILES_MODIFIED="$(git --no-pager diff --name-only master...$CI_BUILD_REF | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^test.sh -e ^windows/ -e ^scripts/ -e^mac/ -e ^nsis/ | wc -l)"
export RUST_BACKTRACE=1 export RUST_BACKTRACE=1
TEST=$1 TEST_SWITCH=$1
rust_test () { rust_test () {
git submodule update --init --recursive git submodule update --init --recursive
rustup show rustup show
if [ $RUST_FILES_MODIFIED -eq 0 ]; if [ "${RUST_FILES_MODIFIED}" -eq 0 ];
then echo "Skipping Rust tests since no Rust files modified."; then echo "Skipping Rust tests since no Rust files modified.";
else ./test.sh $CARGOFLAGS; else ./test.sh;
fi fi
if [ "$CI_BUILD_REF_NAME" == "nightly" ]; if [ "$CI_BUILD_REF_NAME" == "nightly" ];
then sh scripts/aura-test.sh; then sh scripts/aura-test.sh;
@ -20,44 +20,44 @@ rust_test () {
} }
js_test () { js_test () {
git submodule update --init --recursive git submodule update --init --recursive
if [ $JS_FILES_MODIFIED -eq 0 ]; if [ "${JS_FILES_MODIFIED}" -eq 0 ];
then echo "Skipping JS deps install since no JS files modified."; then echo "Skipping JS deps install since no JS files modified.";
else ./js/scripts/install-deps.sh; else ./js/scripts/install-deps.sh;
fi fi
if [ $JS_OLD_FILES_MODIFIED -eq 0 ]; if [ "${JS_OLD_FILES_MODIFIED}" -eq 0 ];
then echo "Skipping JS (old) deps install since no JS files modified."; then echo "Skipping JS (old) deps install since no JS files modified.";
else ./js-old/scripts/install-deps.sh; else ./js-old/scripts/install-deps.sh;
fi fi
if [ $JS_FILES_MODIFIED -eq 0 ]; if [ "${JS_FILES_MODIFIED}" -eq 0 ];
then echo "Skipping JS lint since no JS files modified."; then echo "Skipping JS lint since no JS files modified.";
else ./js/scripts/lint.sh && ./js/scripts/test.sh && ./js/scripts/build.sh; else ./js/scripts/lint.sh && ./js/scripts/test.sh && ./js/scripts/build.sh;
fi fi
if [ $JS_OLD_FILES_MODIFIED -eq 0 ]; if [ "${JS_OLD_FILES_MODIFIED}" -eq 0 ];
then echo "Skipping JS (old) lint since no JS files modified."; then echo "Skipping JS (old) lint since no JS files modified.";
else ./js-old/scripts/lint.sh && ./js-old/scripts/test.sh && ./js-old/scripts/build.sh; else ./js-old/scripts/lint.sh && ./js-old/scripts/test.sh && ./js-old/scripts/build.sh;
fi fi
} }
js_release () { js_release () {
rustup default stable rustup default stable
echo $JS_FILES_MODIFIED echo "${JS_FILES_MODIFIED}"
if [ $JS_FILES_MODIFIED -eq 0 ]; if [ "${JS_FILES_MODIFIED}" -eq 0 ];
then echo "Skipping JS deps install since no JS files modified."; then echo "Skipping JS deps install since no JS files modified.";
else ./js/scripts/install-deps.sh; else ./js/scripts/install-deps.sh;
fi fi
if [ $JS_FILES_MODIFIED -eq 0 ]; if [ "${JS_FILES_MODIFIED}" -eq 0 ];
then echo "Skipping JS rebuild since no JS files modified."; then echo "Skipping JS rebuild since no JS files modified.";
else ./js/scripts/build.sh && ./js/scripts/push-precompiled.sh; else ./js/scripts/build.sh && ./js/scripts/push-precompiled.sh;
fi fi
echo $JS_OLD_FILES_MODIFIED echo "${JS_OLD_FILES_MODIFIED}"
if [ $JS_OLD_FILES_MODIFIED -eq 0 ]; if [ "${JS_OLD_FILES_MODIFIED}" -eq 0 ];
then echo "Skipping JS (old) deps install since no JS files modified."; then echo "Skipping JS (old) deps install since no JS files modified.";
else ./js-old/scripts/install-deps.sh; else ./js-old/scripts/install-deps.sh;
fi fi
if [ $JS_OLD_FILES_MODIFIED -eq 0 ]; if [ "${JS_OLD_FILES_MODIFIED}" -eq 0 ];
then echo "Skipping JS (old) rebuild since no JS files modified."; then echo "Skipping JS (old) rebuild since no JS files modified.";
else ./js-old/scripts/build.sh && ./js-old/scripts/push-precompiled.sh; else ./js-old/scripts/build.sh && ./js-old/scripts/push-precompiled.sh;
fi fi
if [ $JS_FILES_MODIFIED -eq 0 ] && [ $JS_OLD_FILES_MODIFIED -eq 0 ]; if [ "${JS_FILES_MODIFIED}" -eq 0 ] && [ "${JS_OLD_FILES_MODIFIED}" -eq 0 ];
then echo "Skipping Cargo update since no JS files modified."; then echo "Skipping Cargo update since no JS files modified.";
else ./js/scripts/push-cargo.sh; else ./js/scripts/push-cargo.sh;
fi fi
@ -68,7 +68,7 @@ coverage_test () {
rm -rf js/.coverage rm -rf js/.coverage
scripts/cov.sh scripts/cov.sh
} }
case TEST in case $TEST_SWITCH in
stable ) stable )
rustup default stable rustup default stable
rust_test rust_test