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

CI improvements #10579

Merged
merged 29 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3438728
check if it was the file
TriplEight Apr 8, 2019
6b1c213
collect tog files
TriplEight Apr 8, 2019
c1ddc29
some debug
TriplEight Apr 8, 2019
d81b5ff
some more debug
TriplEight Apr 8, 2019
ab70b21
some even more debug
TriplEight Apr 8, 2019
408c54a
upload all the logs
TriplEight Apr 8, 2019
ced077d
change cache max size
TriplEight Apr 8, 2019
6cd66f9
test with max cache size overflow
TriplEight Apr 8, 2019
8f66f21
verbose for all cargo jobs
TriplEight Apr 8, 2019
fe90bc5
lower max cache size
TriplEight Apr 8, 2019
099c73a
Rust nightly and beta test runs reintroduced
TriplEight Apr 9, 2019
1c9834f
artifacts:when: always, coz on_success is default
TriplEight Apr 9, 2019
7b857b2
sccache full log
TriplEight Apr 9, 2019
4426345
normal artifacts name, big cache size
TriplEight Apr 9, 2019
ce7f9c9
add file to test the compilation again
TriplEight Apr 10, 2019
3d896fb
another way of getting artifacts
TriplEight Apr 10, 2019
4edeb41
per-job cache
TriplEight Apr 10, 2019
f6b5afe
data race tests
TriplEight Apr 11, 2019
cb07626
is it needed to clean the working folder?
TriplEight Apr 11, 2019
f085448
return to common cache dir
TriplEight Apr 11, 2019
5377f48
do not pass logs between jobs
TriplEight Apr 11, 2019
df4e501
typo
TriplEight Apr 11, 2019
4ad7933
avoid artifacts conflict
TriplEight Apr 11, 2019
3626c84
colored logs
TriplEight Apr 11, 2019
d7bbc18
always colored logs
TriplEight Apr 11, 2019
06aa020
proper stages
TriplEight Apr 11, 2019
85a7911
more proper stages skip-ci
TriplEight Apr 11, 2019
6158703
more proper stages [skip-ci]
TriplEight Apr 11, 2019
23f751b
shouldn't skip ci
TriplEight Apr 11, 2019
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
100 changes: 74 additions & 26 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,116 +31,164 @@ variables:
paths:
- artifacts/

.collect_logs: &collect_logs
artifacts:
name: "${CI_JOB_NAME}_${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}"
when: always
expire_in: 7 days
paths:
- artifacts/

.docker-cache-status: &docker-cache-status
variables:
CARGO_HOME: "/ci-cache/parity-ethereum/cargo/${CI_JOB_NAME}"
dependencies: []
before_script:
- SCCACHE_ERROR_LOG=/builds/parity/parity-ethereum/sccache_error.log RUST_LOG=sccache::server=debug sccache --start-server
- SCCACHE_ERROR_LOG=/builds/parity/parity-ethereum/sccache_debug.log
RUST_LOG=sccache::server=debug
SCCACHE_CACHE_SIZE=50G
SCCACHE_DIR=/ci-cache/parity-ethereum/sccache/
sccache --start-server
- sccache -s
after_script:
- echo "All crate-types:"
- grep 'parse_arguments.*--crate-type' sccache_error.log | sed -re 's/.*"--crate-type", "([^"]+)".*/\1/' | sort | uniq -c
- echo "Non-cacheable reasons:"
- grep CannotCache sccache_error.log | sed -re 's/.*CannotCache\((.+)\).*/\1/' | sort | uniq -c
# sccache debug info
- if test -e sccache_debug.log;
then
echo "All crate-types:";
grep 'parse_arguments.*--crate-type' sccache_debug.log | sed -re 's/.*"--crate-type", "([^"]+)".*/\1/' | sort | uniq -c;
echo "Non-cacheable reasons:";
grep CannotCache sccache_debug.log | sed -re 's/.*CannotCache\((.+)\).*/\1/' | sort | uniq -c;
else
echo "No logs from sccache";
exit 0;
fi
# collect log files
- mkdir -p ./artifacts
- find . -name "*.log"
- find . -name "*.log" | xargs tar --append -f ./artifacts/logs_"${CI_JOB_NAME}_${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}".tar
tags:
- linux-docker

.build-on-linux: &build-on-linux
stage: build
<<: *docker-cache-status
<<: *collect_artifacts
script:
- scripts/gitlab/build-linux.sh
- sccache -s
TriplEight marked this conversation as resolved.
Show resolved Hide resolved


cargo-check 0 3:
stage: test
<<: *docker-cache-status
<<: *collect_logs
script:
- time cargo check --target $CARGO_TARGET --locked --no-default-features
- time cargo check --target $CARGO_TARGET --locked --no-default-features --verbose --color=always
TriplEight marked this conversation as resolved.
Show resolved Hide resolved
- sccache -s

cargo-check 1 3:
stage: test
<<: *docker-cache-status
<<: *collect_logs
script:
- time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --no-default-features
- time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --no-default-features --verbose --color=always
- sccache -s
TriplEight marked this conversation as resolved.
Show resolved Hide resolved

cargo-check 2 3:
stage: test
<<: *docker-cache-status
<<: *collect_logs
script:
- time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --features "mio"
- time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --features "mio" --verbose --color=always
- sccache -s

cargo-audit:
stage: test
<<: *docker-cache-status
script:
- cargo audit
- sccache -s

validate-chainspecs:
stage: test
<<: *docker-cache-status
<<: *collect_logs
script:
- ./scripts/gitlab/validate-chainspecs.sh
- sccache -s

test-cpp:
stage: build
<<: *docker-cache-status
<<: *collect_logs
script:
- ./scripts/gitlab/test-cpp.sh
- sccache -s

test-linux:
stage: build
<<: *docker-cache-status
<<: *collect_logs
script:
- ./scripts/gitlab/test-linux.sh
- ./scripts/gitlab/test-linux.sh stable
- sccache -s

build-android:
test-linux-beta:
stage: build
image: parity/rust-parity-ethereum-android-build:stretch
variables:
CARGO_TARGET: armv7-linux-androideabi
only: *releaseable_branches
<<: *docker-cache-status
<<: *collect_artifacts
<<: *collect_logs
script:
- scripts/gitlab/build-linux.sh
tags:
- linux-docker
- ./scripts/gitlab/test-linux.sh beta
- sccache -s

build-linux: &build-linux
test-linux-nightly:
stage: build
only: *releaseable_branches
<<: *docker-cache-status
<<: *collect_artifacts
<<: *collect_logs
script:
- scripts/gitlab/build-linux.sh
- ./scripts/gitlab/test-linux.sh nightly
- sccache -s
allow_failure: true

build-android:
<<: *build-on-linux
image: parity/rust-parity-ethereum-android-build:stretch
variables:
CARGO_TARGET: armv7-linux-androideabi

build-linux:
<<: *build-on-linux
only: *releaseable_branches

build-linux-i386:
<<: *build-linux
<<: *build-on-linux
only: *releaseable_branches
image: parity/rust-parity-ethereum-build:i386
variables:
CARGO_TARGET: i686-unknown-linux-gnu

build-linux-arm64:
<<: *build-linux
<<: *build-on-linux
only: *releaseable_branches
image: parity/rust-parity-ethereum-build:arm64
variables:
CARGO_TARGET: aarch64-unknown-linux-gnu

build-linux-armhf:
<<: *build-linux
<<: *build-on-linux
only: *releaseable_branches
image: parity/rust-parity-ethereum-build:armhf
variables:
CARGO_TARGET: armv7-unknown-linux-gnueabihf

build-darwin:
stage: build
only: *releaseable_branches
<<: *collect_artifacts
only: *releaseable_branches
variables:
CARGO_TARGET: x86_64-apple-darwin
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo"
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo"
CC: gcc
CXX: g++
script:
Expand Down
4 changes: 2 additions & 2 deletions parity-clib/examples/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
cmake_minimum_required(VERSION 3.5)
include(ExternalProject)
include_directories("${CMAKE_SOURCE_DIR}/../..")
set (CMAKE_CXX_STANDARD 11) # Enfore C++11
set (CMAKE_CXX_STANDARD 11) # Enforce C++11
add_executable(parity-example main.cpp)

ExternalProject_Add(
libparity
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
COMMAND cargo build -p parity-clib # Note: use --release in a real project
COMMAND cargo build -p parity-clib --verbose --color=always # Note: use --release in a real project
BINARY_DIR "${CMAKE_SOURCE_DIR}/../../../target"
INSTALL_COMMAND ""
LOG_BUILD ON)
Expand Down
12 changes: 6 additions & 6 deletions scripts/gitlab/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ cat .cargo/config
echo "_____ Building target: "$CARGO_TARGET" _____"
if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ]
then
time cargo build --target $CARGO_TARGET --release -p parity-clib --features final
time cargo build --target $CARGO_TARGET --verbose --color=always --release -p parity-clib --features final
else
time cargo build --target $CARGO_TARGET --release --features final
time cargo build --target $CARGO_TARGET --release -p evmbin
time cargo build --target $CARGO_TARGET --release -p ethstore-cli
time cargo build --target $CARGO_TARGET --release -p ethkey-cli
time cargo build --target $CARGO_TARGET --release -p whisper-cli
time cargo build --target $CARGO_TARGET --verbose --color=always --release --features final
time cargo build --target $CARGO_TARGET --verbose --color=always --release -p evmbin
time cargo build --target $CARGO_TARGET --verbose --color=always --release -p ethstore-cli
time cargo build --target $CARGO_TARGET --verbose --color=always --release -p ethkey-cli
time cargo build --target $CARGO_TARGET --verbose --color=always --release -p whisper-cli
fi

echo "_____ Post-processing binaries _____"
Expand Down
10 changes: 5 additions & 5 deletions scripts/gitlab/build-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ echo "RUSTC_WRAPPER: " $RUSTC_WRAPPER
echo "SCCACHE_DIR: " $SCCACHE_DIR

echo "_____ Building target: "$CARGO_TARGET" _____"
time cargo build --target $CARGO_TARGET --release --features final
time cargo build --target $CARGO_TARGET --release -p evmbin
time cargo build --target $CARGO_TARGET --release -p ethstore-cli
time cargo build --target $CARGO_TARGET --release -p ethkey-cli
time cargo build --target $CARGO_TARGET --release -p whisper-cli
time cargo build --target $CARGO_TARGET --verbose --release --features final
time cargo build --target $CARGO_TARGET --verbose --release -p evmbin
time cargo build --target $CARGO_TARGET --verbose --release -p ethstore-cli
time cargo build --target $CARGO_TARGET --verbose --release -p ethkey-cli
time cargo build --target $CARGO_TARGET --verbose --release -p whisper-cli

echo "__________Sign binaries__________"
scripts/gitlab/sign-win.cmd $keyfile $certpass target/$CARGO_TARGET/release/parity.exe
Expand Down
7 changes: 6 additions & 1 deletion scripts/gitlab/test-linux.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
# ARGUMENT $1 Rust flavor to run test with (stable/beta/nightly)

echo "________Running test-linux.sh________"
set -e # fail on any error
set -u # treat unset variables as error
Expand All @@ -8,5 +10,8 @@ OPTIONS="--release"
#use nproc `linux only
THREADS=$(nproc)

rustup default $1
rustup show

echo "________Running Parity Full Test Suite________"
time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET -- --test-threads $THREADS
time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=always -- --test-threads $THREADS
2 changes: 1 addition & 1 deletion scripts/gitlab/validate-chainspecs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "________Running validate_chainspecs.sh________"
ERR=0

echo "________Validate chainspecs________"
time cargo build --release -p chainspec
time cargo build --release -p chainspec --verbose --color=always

for spec in ethcore/res/*.json; do
if ! ./target/release/chainspec "$spec"; then ERR=1; fi
Expand Down