Updating the CI system (#8765)

* Updating the CI system with the publication of releases and binary files on github

Signed-off-by: Denis S. Soldatov aka General-Beck <general.beck@gmail.com>

* add missed scripts

* chmod +x scripts

* fix download link for github

* rebuilding CI scripts

* small fixes

* update submodule wasm tests

* ci: fix merge leftovers

* ci: remove gitlab-next from ci triggers

* ci: fix git add in docs script

* ci: use nightly instead of master for publish triggers

* ci: remove sleep from gitlab config

* ci: replace ':' with '-' in gitlab targets

* ci: fix recursive copy in docs script
This commit is contained in:
Denis S. Soldatov aka General-Beck 2018-08-26 02:44:08 +04:00 committed by Afri Schoedon
parent 9ed43230ca
commit bd3bc5c168
25 changed files with 686 additions and 644 deletions

View File

@ -1,242 +1,296 @@
stages: stages:
- test - test
- push-release
- build - build
- package
- publish
- docs - docs
image: parity/rust:gitlab-ci
variables: variables:
RUST_BACKTRACE: "1"
RUSTFLAGS: ""
CARGOFLAGS: ""
CI_SERVER_NAME: "GitLab CI" CI_SERVER_NAME: "GitLab CI"
CARGO_HOME: "${CI_PROJECT_DIR}/cargo"
BUILD_TARGET: ubuntu
BUILD_ARCH: amd64
CARGO_TARGET: x86_64-unknown-linux-gnu
cache: cache:
key: "$CI_BUILD_STAGE-$CI_BUILD_REF_NAME" key: "${CI_JOB_NAME}"
paths: paths:
- target/ - ${CI_PROJECT_DIR}/target/
untracked: true - ${CI_PROJECT_DIR}/cargo/
linux-amd64:
stage: build .releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries")
image: parity/rust:gitlab-ci only: &releaseable_branches
only: - master
- stable
- beta - beta
- tags - tags
- stable
- triggers .publishable_branches: # list of git refs for publishing builds to the "production" locations
only: &publishable_branches
- nightly # Our nightly builds from schedule, on `master`
- "v2*" # Our version tags
.collect_artifacts: &collect_artifacts
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 1 mos
paths:
- artifacts/
.determine_version: &determine_version |
export VERSION=$(grep -m 1 "version =" Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
echo "Version" $VERSION
#### stage: test
test-rust-stable: &test
stage: test
script: script:
- rustup default stable - scripts/gitlab/test.sh stable
# ARGUMENTS: 1. BUILD_PLATFORM (target for binaries) 2. PLATFORM (target for cargo) 3. ARC (architecture) 4. & 5. CC & CXX flags 6. binary identifier
- scripts/gitlab-build.sh x86_64-unknown-linux-gnu x86_64-unknown-linux-gnu amd64 gcc g++ linux
tags: tags:
- rust-stable - rust-stable
artifacts:
paths: .optional_test: &optional_test
- parity.zip <<: *test
name: "stable-x86_64-unknown-linux-gnu_parity" allow_failure: true
linux-i686: only:
- master
test-rust-beta:
<<: *optional_test
script:
- scripts/gitlab/test.sh beta
test-rust-nightly:
<<: *optional_test
script:
- scripts/gitlab/test.sh nightly
test-lint-rustfmt:
<<: *optional_test
script:
- scripts/gitlab/rustfmt.sh
test-lint-clippy:
<<: *optional_test
script:
- scripts/gitlab/clippy.sh
test-coverage-kcov:
stage: test
only:
- master
script:
- scripts/gitlab/coverage.sh
tags:
- shell
allow_failure: true
#### stage: build
build-linux-ubuntu-amd64: &build
stage: build stage: build
only: *releaseable_branches
variables:
CARGO_TARGET: x86_64-unknown-linux-gnu
script:
- scripts/gitlab/build-unix.sh
<<: *collect_artifacts
tags:
- rust-stable
allow_failure: true
build-linux-ubuntu-i386:
<<: *build
image: parity/rust-i686:gitlab-ci image: parity/rust-i686:gitlab-ci
only: variables:
- beta CARGO_TARGET: i686-unknown-linux-gnu
- tags
- stable build-linux-ubuntu-arm64:
- triggers <<: *build
script:
- scripts/gitlab-build.sh i686-unknown-linux-gnu i686-unknown-linux-gnu i386 gcc g++ linux
tags:
- rust-i686
artifacts:
paths:
- parity.zip
name: "i686-unknown-linux-gnu"
allow_failure: true
linux-armv7:
stage: build
image: parity/rust-armv7:gitlab-ci
only:
- beta
- tags
- stable
- triggers
script:
- scripts/gitlab-build.sh armv7-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf armhf arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++ linux
tags:
- rust-arm
artifacts:
paths:
- parity.zip
name: "armv7_unknown_linux_gnueabihf_parity"
allow_failure: true
linux-armhf:
stage: build
image: parity/rust-arm:gitlab-ci
only:
- beta
- tags
- stable
- triggers
script:
- scripts/gitlab-build.sh arm-unknown-linux-gnueabihf arm-unknown-linux-gnueabihf armhf arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++ linux
tags:
- rust-arm
artifacts:
paths:
- parity.zip
name: "arm-unknown-linux-gnueabihf_parity"
allow_failure: true
linux-aarch64:
stage: build
image: parity/rust-arm64:gitlab-ci image: parity/rust-arm64:gitlab-ci
only: variables:
- beta CARGO_TARGET: aarch64-unknown-linux-gnu
- tags
- stable build-linux-ubuntu-armhf:
- triggers <<: *build
script: image: parity/rust-armv7:gitlab-ci
- scripts/gitlab-build.sh aarch64-unknown-linux-gnu aarch64-unknown-linux-gnu arm64 aarch64-linux-gnu-gcc aarch64-linux-gnu-g++ linux variables:
tags: CARGO_TARGET: armv7-unknown-linux-gnueabihf
- rust-arm
artifacts: build-linux-android-armhf:
paths: <<: *build
- parity.zip image: parity/rust-android:gitlab-ci
name: "aarch64-unknown-linux-gnu_parity" variables:
linux-snap: CARGO_TARGET: armv7-linux-androideabi
stage: build
image: parity/snapcraft:gitlab-ci build-darwin-macos-x86_64:
only: <<: *build
- stable variables:
- beta CARGO_TARGET: x86_64-apple-darwin
- tags CC: gcc
- triggers CXX: g++
script:
- scripts/gitlab-build.sh x86_64-unknown-snap-gnu x86_64-unknown-linux-gnu amd64 gcc g++ snap
tags:
- rust-stable
artifacts:
paths:
- parity.zip
name: "stable-x86_64-unknown-snap-gnu_parity"
darwin:
stage: build
only:
- beta
- tags
- stable
- triggers
script:
- scripts/gitlab-build.sh x86_64-apple-darwin x86_64-apple-darwin macos gcc g++ macos
tags: tags:
- osx - osx
artifacts: <<: *collect_artifacts
paths:
- parity.zip build-windows-msvc-x86_64:
name: "x86_64-apple-darwin_parity"
windows:
cache:
key: "%CI_BUILD_STAGE%-%CI_BUILD_REF_NAME%"
untracked: true
stage: build stage: build
only: only: *releaseable_branches
- beta cache:
- tags key: "%CI_JOB_NAME%"
- stable paths:
- triggers - "%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: script:
- sh scripts/gitlab-build.sh x86_64-pc-windows-msvc x86_64-pc-windows-msvc amd64 "" "" windows - sh scripts/gitlab/build-windows.sh
tags: tags:
- rust-windows - rust-windows
artifacts: <<: *collect_artifacts
paths:
- parity.zip
name: "x86_64-pc-windows-msvc_parity" #### stage: package
android-armv7:
stage: build package-linux-snap-amd64: &package_snap
image: parity/parity-android:latest stage: package
only: only: *releaseable_branches
- beta cache: {}
- tags
- stable
- triggers
script:
- cargo build --target=armv7-linux-androideabi
tags:
- rust-arm
allow_failure: true
artifacts:
paths:
- parity.zip
name: "armv7-linux-androideabi_parity"
docker-build:
stage: build
only:
- tags
- master
- beta
- stable
- triggers
before_script: before_script:
- docker info - *determine_version
variables:
CARGO_TARGET: x86_64-unknown-linux-gnu
dependencies:
- build-linux-ubuntu-amd64
script: script:
- if [ "$CI_BUILD_REF_NAME" == "master" ]; then DOCKER_TAG="latest"; else DOCKER_TAG=$CI_BUILD_REF_NAME; fi - scripts/gitlab/package-snap.sh
- echo "Tag:" $DOCKER_TAG
- docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity
- scripts/docker-build.sh $DOCKER_TAG
- docker logout
tags:
- docker
test-coverage:
stage: test
only:
- master
script:
- scripts/gitlab-test.sh test-coverage
tags:
- kcov
allow_failure: true
test-rust-stable:
stage: test
image: parity/rust:gitlab-ci
script:
- scripts/gitlab-test.sh stable
tags: tags:
- rust-stable - rust-stable
test-rust-beta: <<: *collect_artifacts
stage: test
only: package-linux-snap-i386:
- triggers <<: *package_snap
- master variables:
image: parity/rust:gitlab-ci BUILD_ARCH: i386
CARGO_TARGET: i686-unknown-linux-gnu
dependencies:
- build-linux-ubuntu-i386
package-linux-snap-arm64:
<<: *package_snap
variables:
BUILD_ARCH: arm64
CARGO_TARGET: aarch64-unknown-linux-gnu
dependencies:
- build-linux-ubuntu-arm64
package-linux-snap-armhf:
<<: *package_snap
variables:
BUILD_ARCH: armhf
CARGO_TARGET: armv7-unknown-linux-gnueabihf
dependencies:
- build-linux-ubuntu-armhf
#### stage: publish
publish-linux-snap-amd64: &publish_snap
stage: publish
only: *publishable_branches
image: snapcore/snapcraft:stable
cache: {}
before_script:
- *determine_version
variables:
BUILD_ARCH: amd64
dependencies:
- package-linux-snap-amd64
script: script:
- scripts/gitlab-test.sh beta - scripts/gitlab/publish-snap.sh
tags: tags:
- rust-beta - rust-stable
publish-linux-snap-i386:
<<: *publish_snap
before_script:
- *determine_version
variables:
BUILD_ARCH: i386
dependencies:
- package-linux-snap-i386
publish-linux-snap-arm64:
<<: *publish_snap
before_script:
- *determine_version
variables:
BUILD_ARCH: arm64
dependencies:
- package-linux-snap-arm64
publish-linux-snap-armhf:
<<: *publish_snap
before_script:
- *determine_version
variables:
BUILD_ARCH: armhf
dependencies:
- package-linux-snap-armhf
publish-docker-parity-amd64: &publish_docker
stage: publish
only: *publishable_branches
cache: {}
dependencies:
- build-linux-ubuntu-amd64
tags:
- shell
allow_failure: true allow_failure: true
test-rust-nightly:
stage: test
only:
- triggers
- master
image: parity/rust:gitlab-ci
script: script:
- scripts/gitlab-test.sh nightly - scripts/gitlab/publish-docker.sh parity
publish-docker-parityevm-amd64:
<<: *publish_docker
script:
- scripts/gitlab/publish-docker.sh parity-evm
publish-github-and-s3:
stage: publish
only: *publishable_branches
cache: {}
dependencies:
- build-linux-ubuntu-amd64
- build-linux-ubuntu-i386
- build-linux-ubuntu-armhf
- build-linux-ubuntu-arm64
- build-darwin-macos-x86_64
- build-windows-msvc-x86_64
before_script:
- *determine_version
script:
- scripts/gitlab/push.sh
tags: tags:
- rust - shell
- rust-nightly
allow_failure: true allow_failure: true
json-rpc-docs:
####stage: docs
docs-rpc-json:
stage: docs stage: docs
only: only:
- tags - tags
image: parity/rust:gitlab-ci cache: {}
script: script:
- scripts/gitlab-rpc-docs.sh - scripts/gitlab/rpc-docs.sh
tags: tags:
- docs - shell
push-release:
stage: push-release
only:
- tags
- triggers
image: parity/rust:gitlab-ci
script:
- scripts/gitlab-push-release.sh
tags:
- curl

View File

@ -1,64 +1,27 @@
FROM ubuntu:xenial FROM ubuntu:xenial
MAINTAINER Parity Technologies <devops@parity.io> MAINTAINER Parity Technologies <devops@parity.io>
WORKDIR /build #set ENVIROMENT
#ENV for build TAG ARG TARGET
ARG BUILD_TAG ENV TARGET ${TARGET}
ENV BUILD_TAG ${BUILD_TAG:-master}
RUN echo "Build tag:" $BUILD_TAG
# install tools and dependencies # install tools and dependencies
RUN apt-get update && \ RUN apt update && apt install -y --no-install-recommends openssl libudev-dev file
apt-get install -y --force-yes --no-install-recommends \
# make
build-essential \
# add-apt-repository
software-properties-common \
make \
cmake \
curl \
wget \
git \
g++ \
gcc \
libc6 \
libc6-dev \
binutils \
file \
libudev-dev \
pkg-config \
dpkg-dev &&\
# install rustup
curl https://sh.rustup.rs -sSf | sh -s -- -y && \
# rustup directory
PATH=/root/.cargo/bin:$PATH && \
# show backtraces # show backtraces
RUST_BACKTRACE=1 && \ ENV RUST_BACKTRACE 1
# build parity
cd /build&&git clone https://github.com/paritytech/parity-ethereum && \
cd parity-ethereum&& \
git pull&& \
git checkout $BUILD_TAG && \
cargo build --verbose --release --features final && \
strip /build/parity-ethereum/target/release/parity && \
file /build/parity-ethereum/target/release/parity&&mkdir -p /parity&& cp /build/parity-ethereum/target/release/parity /parity&&\
#cleanup Docker image #cleanup Docker image
rm -rf /root/.cargo&&rm -rf /root/.multirust&&rm -rf /root/.rustup&&rm -rf /build&&\ RUN apt autoremove -y
apt-get purge -y \ RUN apt clean -y
# make RUN rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*
build-essential \
# add-apt-repository #add TARGET to docker image
software-properties-common \ COPY artifacts/x86_64-unknown-linux-gnu/$TARGET /usr/bin/$TARGET
make \
cmake \ # Build a shell script because the ENTRYPOINT command doesn't like using ENV
curl \ RUN echo "#!/bin/bash \n ${TARGET} \$@" > ./entrypoint.sh
wget \ RUN chmod +x ./entrypoint.sh
git \
g++ \
gcc \
binutils \
file \
pkg-config \
dpkg-dev &&\
rm -rf /var/lib/apt/lists/*
# setup ENTRYPOINT # setup ENTRYPOINT
EXPOSE 8080 8545 8180 EXPOSE 5001 8080 8082 8083 8545 8546 8180 30303/tcp 30303/udp
ENTRYPOINT ["/parity/parity"] ENTRYPOINT ["./entrypoint.sh"]

View File

@ -1,31 +0,0 @@
#!/usr/bin/env bash
# Installing KCOV under ubuntu
# https://users.rust-lang.org/t/tutorial-how-to-collect-test-coverages-for-rust-project/650#
### Install deps
# $ sudo apt-get install libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev
#
### Compile kcov
# $ wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && tar xf master.tar.gz
# $ cd kcov-master && mkdir build && cd build
# $ cmake .. && make && sudo make install
### Running coverage
set -x
RUSTFLAGS="-C link-dead-code" cargo test --all --no-run || exit $?
KCOV_TARGET="target/cov"
KCOV_FLAGS="--verify"
mkdir -p $KCOV_TARGET
echo "Cover RUST"
for FILE in `find target/debug/deps ! -name "*.*"`
do
timeout --signal=SIGKILL 5m kcov --include-path=$(pwd) --exclude-path=$(pwd)/target $KCOV_FLAGS $KCOV_TARGET $FILE
done
timeout --signal=SIGKILL 5m kcov --include-path=$(pwd) --exclude-path=$(pwd)/target $KCOV_FLAGS $KCOV_TARGET target/debug/parity-*
echo "Cover JS"
cd js
npm install&&npm run test:coverage
cd ..
bash <(curl -s https://codecov.io/bash)&&
echo "Uploaded code coverage"
exit 0

View File

@ -1,11 +0,0 @@
#!/usr/bin/env bash
cd docker/hub
DOCKER_BUILD_TAG=$1
echo "Docker build tag: " $DOCKER_BUILD_TAG
if [[ "$DOCKER_BUILD_TAG" = "latest" ]]; then
docker build --build-arg BUILD_TAG="master" --no-cache=true --tag parity/parity:$DOCKER_BUILD_TAG .
else
docker build --build-arg BUILD_TAG=$DOCKER_BUILD_TAG --no-cache=true --tag parity/parity:$DOCKER_BUILD_TAG .
fi
docker run -it parity/parity:$DOCKER_BUILD_TAG -v
docker push parity/parity:$DOCKER_BUILD_TAG

View File

@ -1,234 +0,0 @@
#!/usr/bin/env bash
set -e # fail on any error
set -u # treat unset variables as error
#ARGUMENTS: 1. BUILD_PLATFORM (target for binaries) 2. PLATFORM (target for cargo) 3. ARC (architecture) 4. & 5. CC & CXX flags 6. binary identifier
BUILD_PLATFORM=$1
PLATFORM=$2
ARC=$3
CC=$4
CXX=$5
IDENT=$6
VER="$(grep -m 1 "version =" Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")"
S3WIN=""
echo "--------------------"
echo "Build for platform: " $BUILD_PLATFORM
echo "Build identifier: " $IDENT
echo "Cargo target: " $PLATFORM
echo "CC&CXX flags: " $CC ", " $CXX
echo "Architecture: " $ARC
echo "Parity version: " $VER
echo "Branch: " $CI_BUILD_REF_NAME
echo "--------------------"
# NOTE for sha256 we want to display filename as well
# hence we use --* instead of -p *
SHA256_BIN="rhash --sha256"
set_env () {
echo "Set ENVIROMENT"
export HOST_CC=gcc
export HOST_CXX=g++
rm -rf .cargo
mkdir -p .cargo
echo "[target.$PLATFORM]" >> .cargo/config
echo "linker= \"$CC\"" >> .cargo/config
cat .cargo/config
}
set_env_win () {
set PLATFORM=x86_64-pc-windows-msvc
set INCLUDE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\vs2015\VC\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt"
set LIB="C:\vs2015\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64"
set RUST_BACKTRACE=1
#export RUSTFLAGS=$RUSTFLAGS
rustup default stable-x86_64-pc-windows-msvc
echo "@ signtool sign /f "\%"1 /p "\%"2 /tr http://timestamp.comodoca.com /du https://parity.io "\%"3" > sign.cmd
}
build () {
if [[ "windows" = $IDENT ]]
then
# This is a nasty hack till we figure out the proper cargo caching strategy
echo "Remove index"
rm -rf cargo/registry/index/*.
fi
echo "Build parity:"
cargo build --target $PLATFORM --features final --release
echo "Build evmbin:"
cargo build --target $PLATFORM --release -p evmbin
echo "Build ethstore-cli:"
cargo build --target $PLATFORM --release -p ethstore-cli
echo "Build ethkey-cli:"
cargo build --target $PLATFORM --release -p ethkey-cli
echo "Build whisper-cli:"
cargo build --target $PLATFORM --release -p whisper-cli
}
strip_binaries () {
echo "Strip binaries:"
$STRIP_BIN -v target/$PLATFORM/release/parity
$STRIP_BIN -v target/$PLATFORM/release/parity-evm
$STRIP_BIN -v target/$PLATFORM/release/ethstore
$STRIP_BIN -v target/$PLATFORM/release/ethkey
$STRIP_BIN -v target/$PLATFORM/release/whisper;
}
calculate_checksums () {
echo "Checksum calculation:"
rhash --version
rm -rf *.sha256
BIN="target/$PLATFORM/release/parity$S3WIN"
export SHA3="$($BIN tools hash $BIN)"
echo "Parity file SHA3: $SHA3"
$SHA256_BIN target/$PLATFORM/release/parity$S3WIN > parity$S3WIN.sha256
$SHA256_BIN target/$PLATFORM/release/parity-evm$S3WIN > parity-evm$S3WIN.sha256
$SHA256_BIN target/$PLATFORM/release/ethstore$S3WIN > ethstore$S3WIN.sha256
$SHA256_BIN target/$PLATFORM/release/ethkey$S3WIN > ethkey$S3WIN.sha256
$SHA256_BIN target/$PLATFORM/release/whisper$S3WIN > whisper$S3WIN.sha256
}
sign_exe () {
./sign.cmd $keyfile $certpass "target/$PLATFORM/release/parity.exe"
./sign.cmd $keyfile $certpass "target/$PLATFORM/release/parity-evm.exe"
./sign.cmd $keyfile $certpass "target/$PLATFORM/release/ethstore.exe"
./sign.cmd $keyfile $certpass "target/$PLATFORM/release/ethkey.exe"
./sign.cmd $keyfile $certpass "target/$PLATFORM/release/whisper.exe"
}
push_binaries () {
echo "Push binaries to AWS S3"
aws configure set aws_access_key_id $s3_key
aws configure set aws_secret_access_key $s3_secret
if [[ "$CI_BUILD_REF_NAME" = "beta" || "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "nightly" ]];
then
export S3_BUCKET=builds-parity-published;
else
export S3_BUCKET=builds-parity;
fi
aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$BUILD_PLATFORM
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity$S3WIN --body target/$PLATFORM/release/parity$S3WIN
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity$S3WIN.sha256 --body parity$S3WIN.sha256
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity-evm$S3WIN --body target/$PLATFORM/release/parity-evm$S3WIN
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity-evm$S3WIN.sha256 --body parity-evm$S3WIN.sha256
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethstore$S3WIN --body target/$PLATFORM/release/ethstore$S3WIN
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethstore$S3WIN.sha256 --body ethstore$S3WIN.sha256
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN --body target/$PLATFORM/release/ethkey$S3WIN
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN.sha256 --body ethkey$S3WIN.sha256
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/whisper$S3WIN --body target/$PLATFORM/release/whisper$S3WIN
aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/whisper$S3WIN.sha256 --body whisper$S3WIN.sha256
}
make_archive () {
echo "add artifacts to archive"
rm -rf parity.zip
zip -r parity.zip target/$PLATFORM/release/parity$S3WIN target/$PLATFORM/release/parity-evm$S3WIN target/$PLATFORM/release/ethstore$S3WIN target/$PLATFORM/release/ethkey$S3WIN target/$PLATFORM/release/whisper$S3WIN parity$S3WIN.sha256 parity-evm$S3WIN.sha256 ethstore$S3WIN.sha256 ethkey$S3WIN.sha256 whisper$S3WIN.sha256
}
updater_push_release () {
echo "push release"
DATA="commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity$S3WIN&secret=$RELEASES_SECRET"
# Mainnet
source scripts/safe_curl.sh $DATA "http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$BUILD_PLATFORM"
# Kovan
source scripts/safe_curl.sh $DATA "http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$BUILD_PLATFORM"
}
case $BUILD_PLATFORM in
x86_64-unknown-linux-gnu)
#set strip bin
STRIP_BIN="strip"
#package extention
build
strip_binaries
calculate_checksums
make_archive
push_binaries
updater_push_release
;;
i686-unknown-linux-gnu)
STRIP_BIN="strip"
set_env
build
strip_binaries
calculate_checksums
make_archive
push_binaries
;;
armv7-unknown-linux-gnueabihf)
STRIP_BIN="arm-linux-gnueabihf-strip"
set_env
build
strip_binaries
calculate_checksums
make_archive
push_binaries
;;
arm-unknown-linux-gnueabihf)
STRIP_BIN="arm-linux-gnueabihf-strip"
set_env
build
strip_binaries
calculate_checksums
make_archive
push_binaries
;;
aarch64-unknown-linux-gnu)
STRIP_BIN="aarch64-linux-gnu-strip"
set_env
build
strip_binaries
calculate_checksums
make_archive
push_binaries
;;
x86_64-apple-darwin)
STRIP_BIN="strip"
PLATFORM="x86_64-apple-darwin"
build
strip_binaries
calculate_checksums
make_archive
push_binaries
updater_push_release
;;
x86_64-unknown-snap-gnu)
ARC="amd64"
EXT="snap"
apt update
apt install -y expect zip rhash
snapcraft clean
echo "Prepare snapcraft.yaml for build on Gitlab CI in Docker image"
sed -i 's/git/'"$VER"'/g' snap/snapcraft.yaml
if [[ "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "beta" || "$VER" == *1.11* || "$VER" == *2.0* ]];
then
sed -i -e 's/grade: devel/grade: stable/' snap/snapcraft.yaml;
fi
mv -f snap/snapcraft.yaml snapcraft.yaml
snapcraft -d
snapcraft_login=$(expect -c "
spawn snapcraft login
expect \"Email:\"
send \"$SNAP_EMAIL\n\"
expect \"Password:\"
send \"$SNAP_PASS\n\"
expect \"\$\"
")
echo "$snapcraft_login"
snapcraft push "parity_"$VER"_amd64.snap"
snapcraft status parity
snapcraft logout
$SHA256_BIN "parity_"$VER"_amd64.snap" > "parity_"$VER"_amd64.snap.sha256"
echo "add artifacts to archive"
rm -rf parity.zip
zip -r parity.zip "parity_"$VER"_amd64.snap" "parity_"$VER"_amd64.snap.sha256"
;;
x86_64-pc-windows-msvc)
set_env_win
EXT="exe"
S3WIN=".exe"
build
sign_exe
calculate_checksums
make_archive
push_binaries
updater_push_release
esac

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
set -e # fail on any error
set -u # treat unset variables as error
DATA="secret=$RELEASES_SECRET"
echo "Pushing release to Mainnet"
./scripts/safe_curl.sh $DATA "http://update.parity.io:1337/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF"
echo "Pushing release to Kovan"
./scripts/safe_curl.sh $DATA "http://update.parity.io:1338/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF"

View File

@ -1,47 +0,0 @@
#!/usr/bin/env bash
#ARGUMENT test for RUST and COVERAGE
set -e # fail on any error
set -u # treat unset variables as error
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
git fetch -a
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/ -e ^docs/ | wc -l)"
echo "RUST_FILES_MODIFIED: $RUST_FILES_MODIFIED"
TEST_SWITCH=$1
rust_test () {
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
# 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
}
coverage_test () {
git submodule update --init --recursive
rm -rf target/*
scripts/cov.sh
}
case $TEST_SWITCH in
stable )
rustup default stable
rust_test
;;
beta)
rustup default beta
rust_test
;;
nightly)
rustup default nightly
rust_test
;;
test-coverage)
coverage_test
;;
esac

35
scripts/gitlab/build-unix.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
echo "__________Show ENVIROMENT__________"
echo "CC: " $CC
echo "CXX: " $CXX
echo "__________CARGO CONFIG__________"
rm -rf .cargo
mkdir -p .cargo
echo "[target.$CARGO_TARGET]" >> .cargo/config
echo "linker= \"$CC\"" >> .cargo/config
cat .cargo/config
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
echo "_____ Post-processing binaries _____"
rm -rf artifacts
mkdir -p artifacts
cd artifacts
mkdir -p $CARGO_TARGET
cd $CARGO_TARGET
cp ../../target/$CARGO_TARGET/release/{parity,parity-evm,ethstore,ethkey,whisper} .
strip -v ./*
echo "_____ Calculating checksums _____"
for binary in $(ls)
do
rhash --sha256 $binary -o $binary.sha256
done

35
scripts/gitlab/build-windows.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
set INCLUDE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\vs2015\VC\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt"
set LIB="C:\vs2015\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64"
rustup default stable-x86_64-pc-windows-msvc
echo "_____ Building _____"
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
echo "__________Sign binaries__________"
scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/parity.exe
scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/parity-evm.exe
scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/ethstore.exe
scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/ethkey.exe
scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/whisper.exe
echo "_____ Post-processing binaries _____"
rm -rf artifacts
mkdir -p artifacts
cd artifacts
mkdir -p $CARGO_TARGET
cd $CARGO_TARGET
cp --verbose ../../target/$CARGO_TARGET/release/{parity.exe,parity-evm.exe,ethstore.exe,ethkey.exe,whisper.exe} .
echo "_____ Calculating checksums _____"
for binary in $(ls)
do
rhash --sha256 $binary -o $binary.sha256
done
cp parity.exe.sha256 parity.sha256

7
scripts/gitlab/clippy.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
cargo install clippy
cargo clippy -- -D warnings

20
scripts/gitlab/coverage.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
set -x
git submodule update --init --recursive
rm -rf target/*
cargo test --all --exclude evmjit --no-run -- --test-threads 8|| exit $?
KCOV_TARGET="target/cov"
KCOV_FLAGS="--verify"
EXCLUDE="/usr/lib,/usr/include,$HOME/.cargo,$HOME/.multirust,rocksdb,secp256k1"
mkdir -p $KCOV_TARGET
echo "__________Cover RUST___________"
for FILE in `find target/debug/deps ! -name "*.*"`
do
timeout --signal=SIGKILL 5m kcov --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET $FILE
done
timeout --signal=SIGKILL 5m kcov --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET target/debug/parity-*
echo "Cover JS"
bash <(curl -s https://codecov.io/bash)&&
echo "Uploaded code coverage"
exit 0

View File

@ -0,0 +1,8 @@
echo "Parity Wallet
=============
Welcome to Parity Wallet, your all-in-one Ethereum node and wallet.
If you continue, Parity will be installed as a user service. You will be able to use the Parity Wallet through your browser by using the menu bar icon, following the shortcut in the Launchpad or navigating to http://localhost:8180/ in your browser.
Parity is distributed under the terms of the GPL."

25
scripts/gitlab/package-snap.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
case ${CI_COMMIT_REF_NAME} in
nightly|*v2.1*) export GRADE="devel";;
beta|*v2.0*) export GRADE="stable";;
stable|*v1.11*) export GRADE="stable";;
*) echo "No release" exit 0;;
esac
SNAP_PACKAGE="parity_"$VERSION"_"$BUILD_ARCH".snap"
echo "__________Create snap package__________"
echo "Release channel :" $GRADE " Branch/tag: " $CI_COMMIT_REF_NAME
snapcraft clean
echo $VERSION:$GRADE:$BUILD_ARCH
cat scripts/gitlab/templates/snapcraft.template.yaml | envsubst '$VERSION:$GRADE:$BUILD_ARCH:$CARGO_TARGET' > snapcraft.yaml
cat snapcraft.yaml
snapcraft --target-arch=$BUILD_ARCH
ls *.snap
echo "__________Post-processing snap package__________"
mkdir -p artifacts
mv -v $SNAP_PACKAGE "artifacts/"$SNAP_PACKAGE
echo "_____ Calculating checksums _____"
cd artifacts
rhash --sha256 $SNAP_PACKAGE -o $SNAP_PACKAGE".sha256"

View File

@ -0,0 +1,22 @@
#!/bin/bash
##ARGUMENTS: 1. Docker target
set -e # fail on any error
set -u # treat unset variables as error
if [ "$CI_COMMIT_REF_NAME" == "beta" ];
then export DOCKER_BUILD_TAG="latest";
else export DOCKER_BUILD_TAG=$CI_COMMIT_REF_NAME;
fi
docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity
echo "__________Docker TAG__________"
echo $DOCKER_BUILD_TAG
echo "__________Docker target__________"
export DOCKER_TARGET=$1
echo $DOCKER_TARGET
echo "__________Docker build and push__________"
docker build --build-arg TARGET=$DOCKER_TARGET --no-cache=true --tag parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG -f docker/hub/Dockerfile .
docker push parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG
docker logout

18
scripts/gitlab/publish-snap.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
case ${CI_COMMIT_REF_NAME} in
nightly|*v2.1*) export CHANNEL="edge";;
beta|*v2.0*) export CHANNEL="beta";;
stable|*v1.11*) export CHANNEL="stable";;
*) echo "No release" exit 0;;
esac
echo "Release channel :" $CHANNEL " Branch/tag: " $CI_COMMIT_REF_NAME
echo $SNAPCRAFT_LOGIN_PARITY_BASE64 | base64 --decode > snapcraft.login
snapcraft login --with snapcraft.login
snapcraft push --release $CHANNEL "artifacts/parity_"$VERSION"_"$BUILD_ARCH".snap"
snapcraft status parity
snapcraft logout

67
scripts/gitlab/push.sh Executable file
View File

@ -0,0 +1,67 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
updater_push_release () {
echo "push release"
# Mainnet
}
echo "__________Set ENVIROMENT__________"
DESCRIPTION="$(cat CHANGELOG.md)"
RELEASE_TABLE="$(cat scripts/gitlab/templates/release-table.md)"
RELEASE_TABLE="$(echo "${RELEASE_TABLE//\$VERSION/${VERSION}}")"
#The text in the file CANGELOG.md before which the table with links is inserted. Must be present in this file necessarily
REPLACE_TEXT="The full list of included changes:"
case ${CI_COMMIT_REF_NAME} in
nightly|*v2.1*) NAME="Parity "$VERSION" nightly";;
beta|*v2.0*) NAME="Parity "$VERSION" beta";;
stable|*v1.11*) NAME="Parity "$VERSION" stable";;
*) echo "No release" exit 0;;
esac
cd artifacts
ls -l | sort -k9
filetest=( * )
echo ${filetest[*]}
for DIR in "${filetest[@]}";
do
cd $DIR
if [[ $DIR == "*windows*" ]];
then
WIN=".exe";
else
WIN="";
fi
for binary in $(ls parity.sha256)
do
sha256=$(cat $binary | awk '{ print $1}' )
case $DIR in
x86_64* )
DATA="commit=$CI_BUILD_REF&sha3=$sha256&filename=parity$WIN&secret=$RELEASES_SECRET"
../../scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$DIR"
# Kovan
../../scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$DIR"
;;
esac
RELEASE_TABLE="$(echo "${RELEASE_TABLE/sha$DIR/${sha256}}")"
done
cd ..
done
#do not touch the following 3 lines. Features of output in Markdown
DESCRIPTION="$(echo "${DESCRIPTION/${REPLACE_TEXT}/${RELEASE_TABLE}
${REPLACE_TEXT}}")"
echo "$DESCRIPTION"
if [["$CI_COMMIT_REF_NAME" == "nightly" ]]; then DESCRIPTION=""; fi #TODO in the future, we need to prepare a script that will do changelog
echo "__________Create release to Github____________"
github-release release --user devops-parity --repo parity-ethereum --tag "$CI_COMMIT_REF_NAME" --draft --name "$NAME" --description "$DESCRIPTION"
echo "__________Push binaries to AWS S3____________"
aws configure set aws_access_key_id $s3_key
aws configure set aws_secret_access_key $s3_secret
if [[ "$CI_BUILD_REF_NAME" = "beta" || "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "nightly" ]];
then
export S3_BUCKET=builds-parity-published;
else
export S3_BUCKET=builds-parity;
fi
aws s3 sync ./ s3://$S3_BUCKET/$CI_BUILD_REF_NAME/

54
scripts/gitlab/rpc-docs.sh Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
clone_repos() {
echo "__________Clone repos__________"
git clone https://github.com/parity-js/jsonrpc.git jsonrpc
git clone https://github.com/paritytech/wiki.git wiki
}
build_docs() {
echo "__________Build docs__________"
npm install
npm run build:markdown
}
update_wiki_docs() {
echo "__________Update WIKI docs__________"
for file in $(ls jsonrpc/docs); do
module_name=${file:0:-3}
mv jsonrpc/docs/$file wiki/JSONRPC-$module_name-module.md
done
}
setup_git() {
echo "__________Set github__________"
git config user.email "devops@parity.com"
git config user.name "Devops Parity"
}
commit_files() {
echo "__________Commit files__________"
git checkout -b rpcdoc-update-${CI_COMMIT_REF_NAME}
git add .
git commit -m "Update docs to ${CI_COMMIT_REF_NAME}"
git tag -a "${CI_COMMIT_REF_NAME}"
}
upload_files() {
echo "__________Upload files__________"
git push --tags
}
setup_git
clone_repos
cp -r parity/ jsonrpc/.parity/
cd jsonrpc
build_docs
cd ..
update_wiki_docs
cd wiki
commit_files
upload_files

7
scripts/gitlab/rustfmt.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
cargo install rustfmt-nightly
cargo fmt -- --write-mode=diff

1
scripts/gitlab/sign.cmd Executable file
View File

@ -0,0 +1 @@
@signtool sign /f %1 /p %2 /tr http://timestamp.comodoca.com /du https://parity.io %3

View File

@ -0,0 +1,16 @@
| OS | Arch | Download | SHA256 Checksum |
|:---:|:---:|:---|:---|
| linux | arm64 | [parity](https://releases.parity.io/$VERSION/aarch64-unknown-linux-gnu/parity) | <sup>`shaaarch64-unknown-linux-gnu`</sup> |
| android | armv7 | [parity](https://releases.parity.io/$VERSION/armv7-linux-androideabi/parity) | <sup>`shaarmv7-linux-androideabi`</sup> |
| linux | armv7 | [parity](https://releases.parity.io/$VERSION/armv7-unknown-linux-gnueabihf/parity) | <sup>`shaarmv7-unknown-linux-gnueabihf`</sup> |
| linux | i686 | [parity](https://releases.parity.io/$VERSION/i686-unknown-linux-gnu/parity) | <sup>`shai686-unknown-linux-gnu`</sup> |
| osx | x64 | [parity](https://releases.parity.io/$VERSION/x86_64-apple-darwin/parity) | <sup>`shax86_64-apple-darwin`</sup> |
| windows | x64 | [parity.exe](https://releases.parity.io/$VERSION/x86_64-pc-windows-msvc/parity.exe) | <sup>`shax86_64-pc-windows-msvc`</sup> |
| linux | x64 | [parity](https://releases.parity.io/$VERSION/x86_64-unknown-linux-gnu/parity) | <sup>`shax86_64-unknown-linux-gnu`</sup> |
| OS | Alternative | Link |
|:---:|:---:|:---|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/apple.png" alt="Apple Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | Homebrew |[github.com/paritytech/homebrew-paritytech/blob/master/README.md](https://github.com/paritytech/homebrew-paritytech/blob/master/README.md) |
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/linux.png" alt="Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | Snapcraft | [snapcraft.io/parity](https://snapcraft.io/parity/) |
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/settings.png" alt="Settings Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | Docker | [hub.docker.com/r/parity/parity](https://hub.docker.com/r/parity/parity) |
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/settings.png" alt="Settings Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | Other binaries | [vanity-service.parity.io/parity-binaries?format=markdown&version=$VERSION](https://vanity-service.parity.io/parity-binaries?format=markdown&version=$VERSION) |

View File

@ -0,0 +1,58 @@
name: parity
version: $VERSION
architectures: [$BUILD_ARCH]
grade: $GRADE
confinement: strict
summary: Fast, light, robust Ethereum implementation
description: |
Parity's goal is to be the fastest, lightest, and most secure Ethereum
client. We are developing Parity using the sophisticated and cutting-edge
Rust programming language. Parity is licensed under the GPLv3, and can be
used for all your Ethereum needs.
apps:
parity:
command: parity
plugs: [home, network, network-bind, mount-observe, x11, unity7, desktop, desktop-legacy, wayland]
desktop: usr/share/applications/parity.desktop
parity-evm:
command: parity-evm
plugs: [home, network, network-bind]
ethkey:
command: ethkey
plugs: [home]
ethstore:
command: ethstore
plugs: [home]
whisper:
command: whisper
plugs: [home]
icon: snap/gui/icon.png
parts:
desktop-icon:
source: ./snap
plugin: nil
override-build: |
mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/applications
mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps
cp -v gui/parity.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/
cp -v gui/icon.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/
parity:
source: ./artifacts/$CARGO_TARGET
plugin: nil
override-build: |
mkdir -p $SNAPCRAFT_PART_INSTALL/usr/bin
cp -v parity $SNAPCRAFT_PART_INSTALL/usr/bin/parity
cp -v parity-evm $SNAPCRAFT_PART_INSTALL/usr/bin/parity-evm
cp -v ethkey $SNAPCRAFT_PART_INSTALL/usr/bin/ethkey
cp -v ethstore $SNAPCRAFT_PART_INSTALL/usr/bin/ethstore
cp -v whisper $SNAPCRAFT_PART_INSTALL/usr/bin/whisper
stage-packages: [libc6, libssl1.0.0, libudev1, libstdc++6, cmake]
df:
plugin: nil
stage-packages: [coreutils]
stage: [bin/df]

28
scripts/gitlab/test.sh Executable file
View File

@ -0,0 +1,28 @@
#!/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
rustup default $1
if [[ "$CI_COMMIT_REF_NAME" = "beta" || "$CI_COMMIT_REF_NAME" = "stable" ]]; then
export GIT_COMPARE=$CI_COMMIT_REF_NAME~;
else
export GIT_COMPARE=master;
fi
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)"
echo "RUST_FILES_MODIFIED: $RUST_FILES_MODIFIED"
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
# 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

View File

@ -1,41 +0,0 @@
name: parity
version: git
summary: Fast, light, robust Ethereum implementation
description: |
Parity's goal is to be the fastest, lightest, and most secure Ethereum
client. We are developing Parity using the sophisticated and cutting-edge
Rust programming language. Parity is licensed under the GPLv3, and can be
used for all your Ethereum needs.
grade: devel
confinement: strict
apps:
parity:
command: parity
plugs: [home, network, network-bind, mount-observe, x11, unity7, desktop, desktop-legacy, wayland]
desktop: usr/share/applications/parity.desktop
icon: snap/gui/icon.png
parts:
desktop-icon:
source: ./snap
plugin: nil
prepare: |
mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/applications
mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps
cp -v gui/parity.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/
cp -v gui/icon.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/
parity:
source: .
plugin: rust
# rust-channel: stable # @TODO enable after https://bugs.launchpad.net/snapcraft/+bug/1778530
rust-revision: 1.26.2 # @TODO remove after https://bugs.launchpad.net/snapcraft/+bug/1778530
build-attributes: [no-system-libraries]
build-packages: [g++, libudev-dev, make, pkg-config, cmake]
stage-packages: [libc6, libudev1, libstdc++6]
df:
plugin: nil
stage-packages: [coreutils]
stage: [bin/df]

10
test.sh
View File

@ -32,13 +32,13 @@ set -e
if [ "$VALIDATE" -eq "1" ]; then if [ "$VALIDATE" -eq "1" ]; then
# Validate --no-default-features build # Validate --no-default-features build
echo "________Validate build________" echo "________Validate build________"
cargo check --no-default-features time cargo check --no-default-features
cargo check --manifest-path util/io/Cargo.toml --no-default-features time cargo check --manifest-path util/io/Cargo.toml --no-default-features
cargo check --manifest-path util/io/Cargo.toml --features "mio" time cargo check --manifest-path util/io/Cargo.toml --features "mio"
# Validate chainspecs # Validate chainspecs
echo "________Validate chainspecs________" echo "________Validate chainspecs________"
./scripts/validate_chainspecs.sh time ./scripts/validate_chainspecs.sh
fi fi
@ -57,4 +57,4 @@ cd parity-clib-examples/cpp && \
# Running tests # Running tests
echo "________Running Parity Full Test Suite________" echo "________Running Parity Full Test Suite________"
git submodule update --init --recursive git submodule update --init --recursive
cargo test -j 8 $OPTIONS --features "$FEATURES" --all $1 time cargo test $OPTIONS --features "$FEATURES" --all $1 -- --test-threads 8