Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix coverage, badge, docker release on in master branch #2218

Merged
merged 9 commits into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## NEAR Protocol - scalable and usable blockchain

![Build status](https://gitlab.com/near-protocol/nearcore/badges/master/pipeline.svg)
[![Build status](https://badge.buildkite.com/a81147cb62c585cc434459eedd1d25e521453120ead9ee6c64.svg)](https://buildkite.com/nearprotocol/nearcore)
[![codecov](https://codecov.io/gh/nearprotocol/nearcore/branch/master/graph/badge.svg)](https://codecov.io/gh/nearprotocol/nearcore)
[![dependency status](https://deps.rs/repo/github/nearprotocol/nearcore/status.svg)](https://deps.rs/repo/github/nearprotocol/nearcore)
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/near)
Expand Down
28 changes: 10 additions & 18 deletions scripts/docker-release.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
#!/bin/bash
function make_sure {
read -p "$1. Are you sure [y/n]? " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
}
set -euo pipefail

branch=$(git rev-parse --abbrev-ref HEAD)
if [ "${branch}" != "master" ]; then
make_sure "Not in master branch"
fi

if [ -n "$(git status -s)" ]; then
make_sure "There's untracked files or uncommitted changes"
fi
branch=${BUILDKITE_BRANCH}
commit=${BUILDKITE_COMMIT}

make
docker tag nearcore nearprotocol/nearcore:latest
docker push nearprotocol/nearcore:latest
# Here we don't check master, beta and stable criteria, they have to be checked in buildkite pipeline
# before this script. And nearprotocol/nearcore:latest must be manually tagged from a verified stable.
docker tag nearcore nearprotocol/nearcore:${branch}-${commit}
docker tag nearcore nearprotocol/nearcore:${branch}
set -x
docker push nearprotocol/nearcore:${branch}-${commit}
docker push nearprotocol/nearcore:${branch}
12 changes: 11 additions & 1 deletion scripts/near-kcov-runtime.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
FROM amazonlinux:2 as builder

RUN yum update -y && yum install -y \
openssl-devel.x86_64 elfutils-libelf-devel libcurl-devel binutils-devel elfutils-devel zlib-devel git cmake3 ninja-build python3 \
openssl-devel.x86_64 elfutils-libelf-devel libcurl-devel binutils-devel elfutils-devel zlib-devel \
git gcc-c++ make ninja-build python3 tar wget \
&& yum clean all && rm -rf /var/cache/yum

RUN wget https://cmake.org/files/v3.10/cmake-3.10.0.tar.gz && \
tar -xvzf cmake-3.10.0.tar.gz && \
cd cmake-3.10.0 && \
./bootstrap && \
make && \
make install && \
cd .. && \
rm -rf cmake*

RUN git clone https://github.com/SimonKagstrom/kcov.git

WORKDIR /kcov
Expand Down
4 changes: 2 additions & 2 deletions scripts/parallel_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def merge_coverage(i, to_merge, j):
break
subprocess.check_output(f'mkdir -p {coverage_dir(i+1)}', shell=True)

cov_to_merge = list(grouper(covs, 2 ))
cov_to_merge = list(grouper(covs, 2))
if cov_to_merge[-1][-1] is None:
# ensure the last to merge is not only one cov
cov_to_merge[-2] += (cov_to_merge[-1][0],)
Expand All @@ -103,7 +103,7 @@ def merge_coverage(i, to_merge, j):
j+=1
futures.append(executor.submit(merge_coverage, i, cov, j))

for _ in as_completed(futures):
for f in as_completed(futures):
pass

i+=1
Expand Down
16 changes: 0 additions & 16 deletions scripts/upload_release.sh

This file was deleted.