Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Simultaneous platform tests WIP #9557

Merged
merged 9 commits into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,46 @@ test-rust-stable: &test
tags:
- rust-stable

test-darwin-macos-x86_64:
stage: test
variables:
CARGO_TARGET: x86_64-apple-darwin
CC: gcc
CXX: g++
script:
- scripts/gitlab/test.sh stable
tags:
- osx

test-linux-android-armhf:
stage: test
image: parity/rust-android:gitlab-ci
variables:
CARGO_TARGET: armv7-linux-androideabi
script:
- scripts/gitlab/test.sh stable
tags:
- rust-arm

test-windows-msvc-x86_64:
stage: test
cache:
key: "%CI_JOB_NAME%"
paths:
- "%CI_PROJECT_DIR%/target/"
- "%CI_PROJECT_DIR%/cargo/"
# No cargo caching, since fetch-locking on Windows gets stuck
variables:
CARGO_TARGET: x86_64-pc-windows-msvc
script:
- sh scripts/gitlab/test.sh stable
tags:
- rust-windows





.optional_test: &optional_test
<<: *test
allow_failure: true
Expand Down Expand Up @@ -139,6 +179,7 @@ build-linux-ubuntu-armhf:

build-linux-android-armhf:
stage: build
only: *releaseable_branches
image: parity/rust-android:gitlab-ci
variables:
CARGO_TARGET: armv7-linux-androideabi
Expand All @@ -149,6 +190,7 @@ build-linux-android-armhf:

build-darwin-macos-x86_64:
stage: build
only: *releaseable_branches
variables:
CARGO_TARGET: x86_64-apple-darwin
CC: gcc
Expand All @@ -161,6 +203,7 @@ build-darwin-macos-x86_64:

build-windows-msvc-x86_64:
stage: build
only: *releaseable_branches
cache:
key: "%CI_JOB_NAME%"
paths:
Expand Down
38 changes: 27 additions & 11 deletions scripts/gitlab/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,41 @@
set -e # fail on any error
set -u # treat unset variables as error

rustup default $1

if [[ "$CI_COMMIT_REF_NAME" = "master" || "$CI_COMMIT_REF_NAME" = "beta" || "$CI_COMMIT_REF_NAME" = "stable" ]]; then
export GIT_COMPARE=$CI_COMMIT_REF_NAME~;
else
export GIT_COMPARE=master;
fi
set -x # full command output for development
git log --graph --oneline --all --decorate=short -n 10


case $CI_COMMIT_REF_NAME in
(master|beta|stable)
export GIT_COMPARE=$CI_COMMIT_REF_NAME~
;;
(*)
export GIT_COMPARE=master
;;
esac

export RUST_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep -v -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 $GIT_COMPARE...$CI_COMMIT_SHA | grep -v -e ^\\. -e ^LICENSE -e ^README.md -e ^test.sh -e ^scripts/ | wc -l | tr -d ' ')"
echo "RUST_FILES_MODIFIED: $RUST_FILES_MODIFIED"


if [ "${RUST_FILES_MODIFIED}" = "0" ]
then
echo "__________Skipping Rust tests since no Rust files modified__________";
exit 0
fi


rustup default $1

git submodule update --init --recursive
rustup show
if [[ "${RUST_FILES_MODIFIED}" == "0" ]];
then echo "__________Skipping Rust tests since no Rust files modified__________";
else ./test.sh || exit $?;
fi

exec ./test.sh

# if [[ "$CI_COMMIT_REF_NAME" == "nightly" ]];
# ### @TODO re-enable fail after https://github.com/paritytech/parity-import-tests/issues/3
# then sh scripts/aura-test.sh; # || exit $?;
# fi