Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:/skalenetwork/skaled into bug/SK…
Browse files Browse the repository at this point in the history
…ALE-2278-net-version
  • Loading branch information
dimalit committed May 8, 2020
2 parents 78b8209 + 6f9aee2 commit 3ef6a37
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 268 deletions.
131 changes: 59 additions & 72 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
- First Change
- Second Change
draft: false
prerelease: false
- name: extract repo name
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
shell: bash
- run: echo "$REPOSITORY_NAME"
- name: Extract branch name
run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
- name: Print branch name
run: echo "${BRANCH_NAME}"
- name: checkout
uses: actions/checkout@v1
- name: submodule update
Expand Down Expand Up @@ -75,7 +58,7 @@ jobs:
php7.4-tidy php7.4-xml php7.4-xmlrpc php7.4-xsl php7.4-zip php-amqp php-apcu \
php-igbinary php-memcache php-memcached php-mongodb php-redis php-xdebug \
php-zmq snmp pollinate libpq-dev postgresql-client powershell ruby-full \
sphinxsearch subversion mongodb-org > /dev/null 2>&1;
sphinxsearch subversion mongodb-org || true > /dev/null 2>&1;
- name: Cleanup
run: |
sudo apt-get autoremove -y >/dev/null 2>&1 && \
Expand All @@ -84,11 +67,12 @@ jobs:
docker rmi $(docker image ls -aq) >/dev/null 2>&1
- name: install packages
run: |
sudo apt-get update; sudo apt-get install -yq libprocps-dev \
g++-7 ccache flex bison yasm python python-pip texinfo \
clang-format-6.0 btrfs-progs cmake libtool build-essential \
pkg-config autoconf wget git libargtable2-dev libmicrohttpd-dev libhiredis-dev \
redis-server openssl libssl-dev doxygen vim
sudo apt-get update; sudo apt-get install -yq build-essential gcc-7 g++-7 \
make ccache cmake libtool pkg-config autoconf autogen automake autopoint \
python python-pip sed shtool texinfo gperf gawk wget git flex bison yasm \
clang-format-6.0 btrfs-progs doxygen vim nettle-dev gnutls-dev \
libhiredis-dev redis-server google-perftools libgoogle-perftools-dev lcov
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
Expand All @@ -104,60 +88,63 @@ jobs:
${ { matrix.config.name } }-ccache-
- name: build
run: |
export CC=gcc-7 &&
export CXX=g++-7 &&
export TARGET=all &&
export TRAVIS_BUILD_TYPE=Debug &&
cd libconsensus/scripts && ./build_deps.sh &&
cd ../../SkaleDeps && ./build.sh &&
cd .. && mkdir build && cmake . -Bbuild -DCMAKE_BUILD_TYPE=Debug &&
cmake --build build -- -j$(nproc)
export CC=gcc-7
export CXX=g++-7
export TARGET=all
export CMAKE_BUILD_TYPE=Debug
export CODE_COVERAGE=ON
cd deps
./build.sh PARALLEL_COUNT=$(nproc)
cd .. && mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCOVERAGE=$CODE_COVERAGE ..
make format-check
make -j$(nproc)
- name: testeth
run : |
cd test && ./testeth -- --express &&
sudo ./testeth -t BtrfsTestSuite -- --all &&
sudo ./testeth -t HashSnapshotTestSuite -- --all &&
sudo ./testeth -t ClientSnapshotsSuite -- --all &&
cd .. &&
lcov --capture --directory . --output-file coverage.info && \
lcov --remove coverage.info '/usr/*' --output-file coverage.info && \
lcov --remove coverage.info 'SkaleDeps/*' --output-file coverage.info && \
lcov --remove coverage.info '.hunter/*' --output-file coverage.info && \
bash <(curl -s https://codecov.io/bash) -f coverage.info -t $CODECOV_TOKEN || \
echo "Codecov did not collect coverage reports"
- name: build image
run : |
ls && ls skaled && \
cp skaled/skaled scripts/skale_build/executable/ && \
export VERSION=$(cat ../VERSION) && \
export VERSION=$( scripts/calculate_version.sh ${BRANCH_NAME} ${VERSION} ) && \
echo "Version $VERSION" && \
cd scripts/skale_build && \
./build_image.sh $VERSION && \
cd ../../build
- name: set tag
run: |
(test ! $ACTION_TAG &&
export ACTION_TAG=v$VERSION &&
git tag ${ACTION_TAG} &&
git push https://[email protected]/skalenetwork/${REPOSITORY_NAME}.git ${ACTION_TAG}
) || true
- name: build and push docker image
run: |
../scripts/skale_build/deploy_image.sh ${VERSION} $DOCKER_USERNAME $DOCKER_PASSWORD || true
- name: deploy master to github releases
cd build/test
./testeth -- --express
sudo NO_ULIMIT_CHECK=1 ./testeth -t BtrfsTestSuite -- --all
sudo NO_ULIMIT_CHECK=1 ./testeth -t HashSnapshotTestSuite -- --all
sudo NO_ULIMIT_CHECK=1 ./testeth -t ClientSnapshotsSuite -- --all
cd ..
# Create lcov report
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
lcov --remove coverage.info 'deps/*' --output-file coverage.info # filter dependency files
lcov --remove coverage.info 'libconsensus/deps/*' --output-file coverage.info # filter dependency files
lcov --remove coverage.info 'libconsensus/libBLS/deps/*' --output-file coverage.info # filter dependency files
lcov --remove coverage.info '.hunter/*' --output-file coverage.info # filter dependency files
#- lcov --list coverage.info # debug info
# Uploading report to CodeCov
bash <(curl -s https://codecov.io/bash) -f coverage.info -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports"
- name: Build and publish container
if: github.event.pull_request.merged
run: |
test ! ${BRANCH_NAME} = "master" || true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
cp build/skaled/skaled ../scripts/skale_build/executable/
export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH"
export VERSION=$(bash ./scripts/calculate_version.sh)
echo "::set-env name=VERSION::$VERSION"
echo "Version $VERSION"
export RELEASE=true
echo "::set-env name=RELEASE::$RELEASE"
bash ./scripts/build_and_publish.sh
- name: Create Release
if: github.event.pull_request.merged
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: skaled/skaled
asset_name: skaled
asset_content_type: application/octet-stream
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
body: |
Changes in this Release
- First Change
- Second Change
draft: false
prerelease: true



Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
esl-erlang firefox g++-8 g++-9 gfortran-8 gfortran-9 google-chrome-stable >/dev/null 2>&1;
- name: Free more disk space
run: |
sudo apt-get remove -yq > \
sudo apt-get remove -yq \
google-cloud-sdk ghc-8.0.2 ghc-8.2.2 ghc-8.4.4 ghc-8.6.2 ghc-8.6.3 ghc-8.6.4 \
ghc-8.6.5 ghc-8.8.1 ghc-8.8.2 ghc-8.8.3 ghc-8.10.1 cabal-install-2.0 cabal-install-2.2 \
cabal-install-2.4 cabal-install-3.0 cabal-install-3.2 heroku imagemagick \
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
php7.4-tidy php7.4-xml php7.4-xmlrpc php7.4-xsl php7.4-zip php-amqp php-apcu \
php-igbinary php-memcache php-memcached php-mongodb php-redis php-xdebug \
php-zmq snmp pollinate libpq-dev postgresql-client powershell ruby-full \
sphinxsearch subversion mongodb-org > /dev/null 2>&1;
sphinxsearch subversion mongodb-org || true > /dev/null 2>&1;
- name: Cleanup
run: |
sudo apt-get autoremove -y >/dev/null 2>&1 && \
Expand Down
175 changes: 0 additions & 175 deletions .travis.yml

This file was deleted.

33 changes: 33 additions & 0 deletions scripts/build_and_publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

set -e

: "${VERSION?Need to set VERSION}"
: "${BRANCH?Need to set BRANCH}"

NAME=schain
REPO_NAME=skalenetwork/$NAME
IMAGE_NAME=$REPO_NAME:$VERSION
LATEST_IMAGE_NAME=$REPO_NAME:$BRANCH-latest

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"


# Build image

echo "Building $IMAGE_NAME..."
docker build -t $IMAGE_NAME $DIR/skale_build || exit $?
docker tag $IMAGE_NAME $LATEST_IMAGE_NAME

echo "========================================================================================="
echo "Built $IMAGE_NAME"

# Publish image

: "${DOCKER_USERNAME?Need to set DOCKER_USERNAME}"
: "${DOCKER_PASSWORD?Need to set DOCKER_PASSWORD}"

echo "$DOCKER_PASSWORD" | docker login --username $DOCKER_USERNAME --password-stdin

docker push $IMAGE_NAME || exit $?
docker push $LATEST_IMAGE_NAME || exit $?
Loading

0 comments on commit 3ef6a37

Please sign in to comment.