Add github actions

This commit is contained in:
adria0
2020-07-29 11:45:51 +02:00
committed by Artem Vorotnikov
parent 544725a018
commit 82b37bfa0d
22 changed files with 631 additions and 760 deletions

22
scripts/actions/build-linux.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
#strip ON
export RUSTFLAGS=" -Clink-arg=-s -Ctarget-feature=+aes,+sse2,+ssse3"
echo "_____ Build OpenEthereum and tools _____"
time cargo build --verbose --color=always --release --features final
time cargo build --verbose --color=always --release -p evmbin
time cargo build --verbose --color=always --release -p ethstore-cli
time cargo build --verbose --color=always --release -p ethkey-cli
echo "_____ Post-processing binaries _____"
rm -rf artifacts/*
mkdir -p artifacts/
cp -v target/release/parity artifacts/parity
cp -v target/release/parity-evm artifacts/parity-evm
cp -v target/release/ethstore artifacts/ethstore
cp -v target/release/ethkey artifacts/ethkey

View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
# NOTE: Enables the aes-ni instructions for RustCrypto dependency.
# If you change this please remember to also update .cargo/config
export RUSTFLAGS=" -Ctarget-feature=+aes,+sse2,+ssse3 -Ctarget-feature=+crt-static -Clink-arg=-s"
echo "_____ Build Parity and tools _____"
time cargo build --verbose --release --features final
time cargo build --verbose --release -p evmbin
time cargo build --verbose --release -p ethstore-cli
time cargo build --verbose --release -p ethkey-cli
echo "_____ Post-processing binaries _____"
rm -rf artifacts
mkdir -p artifacts
cp --verbose target/release/parity.exe artifacts/parity.exe
cp --verbose target/release/parity-evm.exe artifacts/parity-evm.exe
cp --verbose target/release/ethstore.exe artifacts/ethstore.exe
cp --verbose target/release/ethkey.exe artifacts/ethkey.exe

View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
find ./target/release -maxdepth 1 -type f -delete;
rm -fr ./target/release/{deps,.fingerprint}/*{parity,ethcore,ethkey,ethstore,parity-evm}*;
rm -f ./target/.rustc_info.json;

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env pwsh
$os=$args[0]
$version="0.2.12"
echo "Current OS:" $os
switch ($os){
"macOS" {$platform = "x86_64-apple-darwin"}
"Linux" {$platform = "x86_64-unknown-linux-musl"}
"Windows" {$platform ="x86_64-pc-windows-msvc"}
}
echo "Target arch: " $platform
$basename = "sccache-$version-$platform"
$url = "https://github.com/mozilla/sccache/releases/download/"+"$version/$basename.tar.gz"
echo "Download sccache from "+$url
curl -LO $url
tar -xzvf "$basename.tar.gz"
ls $basename/
. $basename/sccache --start-server
echo "::add-path::$(pwd)/$basename"
echo "::set-env name=RUSTC_WRAPPER::sccache"

View File

@@ -0,0 +1,20 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
echo "________Running validate_chainspecs.sh________"
ERR=0
echo "________Validate chainspecs________"
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
done
for spec in ethcore/res/ethereum/*.json; do
if ! ./target/release/chainspec "$spec"; then ERR=1; fi
done
#show sccache statistics
sccache --stop-server
exit $ERR