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

CI optimizations #10297

Merged
merged 12 commits into from
Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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
27 changes: 6 additions & 21 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ stages:
image: parity/rust:gitlab-ci
TriplEight marked this conversation as resolved.
Show resolved Hide resolved

variables:
GIT_STRATEGY: fetch
GIT_SUBMODULE_STRATEGY: recursive
CI_SERVER_NAME: "GitLab CI"
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo"
CARGO_TARGET: x86_64-unknown-linux-gnu
Expand Down Expand Up @@ -40,14 +42,16 @@ test-linux:
variables:
RUN_TESTS: all
script:
- scripts/gitlab/test-all.sh stable
- scripts/gitlab/test-all.sh
tags:
- rust-stable

test-audit:
stage: test
script:
- scripts/gitlab/cargo-audit.sh
- set -e
- set -u
- cargo audit
tags:
- rust-stable

Expand Down Expand Up @@ -150,22 +154,3 @@ build-android:
allow_failure: true
<<: *collect_artifacts

test-beta:
stage: optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did we remove this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two jobs were to test the code on stable Rust against beta and nightly Rust.
Developers answered they code only on stable Rust so it's not needed. What could be a bit more helpful is nightly build.

variables:
RUN_TESTS: cargo
script:
- scripts/gitlab/test-all.sh beta
tags:
- rust-beta
allow_failure: true

test-nightly:
stage: optional
TriplEight marked this conversation as resolved.
Show resolved Hide resolved
variables:
RUN_TESTS: all
script:
- scripts/gitlab/test-all.sh nightly
tags:
- rust-nightly
allow_failure: true
18 changes: 8 additions & 10 deletions scripts/gitlab/build-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,18 @@ fi

echo "_____ Post-processing binaries _____"
rm -rf artifacts
mkdir -p artifacts
cd artifacts
mkdir -p $CARGO_TARGET
cd $CARGO_TARGET
mkdir -p artifacts/$CARGO_TARGET

if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ]
then
# only thing we need for android
cp -v ../../target/$CARGO_TARGET/release/libparity.so ./libparity.so
cp -v target/$CARGO_TARGET/release/libparity.so ./libparity.so
TriplEight marked this conversation as resolved.
Show resolved Hide resolved
else
cp -v ../../target/$CARGO_TARGET/release/parity ./parity
cp -v ../../target/$CARGO_TARGET/release/parity-evm ./parity-evm
cp -v ../../target/$CARGO_TARGET/release/ethstore ./ethstore
cp -v ../../target/$CARGO_TARGET/release/ethkey ./ethkey
cp -v ../../target/$CARGO_TARGET/release/whisper ./whisper
cp -v target/$CARGO_TARGET/release/parity ./parity
cp -v target/$CARGO_TARGET/release/parity-evm ./parity-evm
cp -v target/$CARGO_TARGET/release/ethstore ./ethstore
cp -v target/$CARGO_TARGET/release/ethkey ./ethkey
cp -v target/$CARGO_TARGET/release/whisper ./whisper
fi

echo "_____ Calculating checksums _____"
Expand Down
7 changes: 0 additions & 7 deletions scripts/gitlab/cargo-audit.sh

This file was deleted.

25 changes: 1 addition & 24 deletions scripts/gitlab/test-all.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
#!/bin/bash
# ARGUMENT $1 Rust flavor to test with (stable/beta/nightly)

set -e # fail on any error
set -u # treat unset variables as error

git log --graph --oneline --decorate=short -n 10

case ${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}} in
(beta|stable)
export GIT_COMPARE=origin/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}~
;;
(master|nightly)
export GIT_COMPARE=master~
;;
(*)
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 ^CHANGELOG.md -e ^test.sh -e ^scripts/ -e ^docs/ -e ^docker/ -e ^snap/ | wc -l | tr -d ' ')"
echo "RUST_FILES_MODIFIED: $RUST_FILES_MODIFIED"

if [ "${RUST_FILES_MODIFIED}" = "0" ]
TriplEight marked this conversation as resolved.
Show resolved Hide resolved
then
echo "__________Skipping Rust tests since no Rust files modified__________";
exit 0
fi

rustup default $1

# FIXME:
TriplEight marked this conversation as resolved.
Show resolved Hide resolved
git submodule update --init --recursive
rustup show

Expand Down
23 changes: 1 addition & 22 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
#!/bin/sh
# Running Parity Full Test Suite
echo "________Running test.sh________"

FEATURES="json-tests,ci-skip-issue"
OPTIONS="--release"
VALIDATE=1
THREADS=8

case $1 in
TriplEight marked this conversation as resolved.
Show resolved Hide resolved
--no-json)
FEATURES="ipc"
shift # past argument=value
;;
--no-release)
OPTIONS=""
shift
;;
--no-validate)
VALIDATE=0
shift
;;
--no-run)
OPTIONS="--no-run"
shift
;;
*)
# unknown option
;;
esac

set -e


Expand Down