This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #841 from EOSIO/nightly_cicd_release
Adding two pipelines for release branch for ci/cd (release 22.0.x)
- Loading branch information
Showing
10 changed files
with
260 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,51 @@ | ||
### Current Version: v0.2.9 | ||
### Test: | ||
#### docker build --tag eosjs-ci:test ./.github/eosjs-ci | ||
#### docker run --publish 8888:8888 eosjs-ci:test | ||
### Deploy: | ||
#### docker build --tag eosio/eosjs-ci:v0.2.9 ./.github/eosjs-ci | ||
#### docker push eosio/eosjs-ci:v0.2.9 | ||
|
||
FROM ubuntu:18.04 | ||
ENTRYPOINT ["nodeos", "--data-dir", "/root/.local/share", "-e", "-p", "eosio", "--replay-blockchain", "--plugin", "eosio::producer_plugin", "--plugin", "eosio::chain_api_plugin", "--plugin", "eosio::trace_api_plugin", "--trace-no-abis", "--plugin", "eosio::db_size_api_plugin", "--plugin", "eosio::http_plugin", "--http-server-address=0.0.0.0:8888", "--access-control-allow-origin=*", "--contracts-console", "--http-validate-host=false", "--enable-account-queries=true", "--verbose-http-errors", "--max-transaction-time=100"] | ||
|
||
ARG EOSBRANCH=develop | ||
ARG CDTBRANCH=develop | ||
FROM eosio/eosio.cdt:${CDTBRANCH} as contracts | ||
WORKDIR /root | ||
### base | ||
RUN yes | unminimize \ | ||
&& apt-get update \ | ||
&& apt-get install -yq \ | ||
binutils-gold \ | ||
build-essential \ | ||
clang-tools-8 \ | ||
curl \ | ||
g++-8 \ | ||
git \ | ||
libcurl4-gnutls-dev \ | ||
libgflags-dev \ | ||
libgmp3-dev \ | ||
libssl-dev \ | ||
libusb-1.0-0-dev \ | ||
lld-8 \ | ||
llvm-7 \ | ||
llvm-7-dev \ | ||
locales \ | ||
ninja-build \ | ||
pkg-config \ | ||
python \ | ||
software-properties-common \ | ||
wget \ | ||
xz-utils \ | ||
zlib1g-dev \ | ||
&& update-alternatives --remove-all cc \ | ||
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-8 100 \ | ||
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 100 \ | ||
&& update-alternatives --remove-all c++ \ | ||
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-8 100 \ | ||
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 100 \ | ||
&& update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-8 100 \ | ||
&& locale-gen en_US.UTF-8 \ | ||
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - | ||
RUN apt-get update \ | ||
&& apt-get install -yq curl git | ||
|
||
ENV LANG=en_US.UTF-8 | ||
RUN git clone https://github.com/EOSIO/eos \ | ||
&& cd eos \ | ||
&& git checkout develop | ||
|
||
### cmake | ||
WORKDIR /root | ||
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz \ | ||
&& tar -xzf cmake-3.13.2.tar.gz \ | ||
&& cd cmake-3.13.2 \ | ||
&& ./bootstrap --prefix=/usr/local --parallel=8 \ | ||
&& make -j8 \ | ||
&& make install \ | ||
&& cd /root \ | ||
&& rm -rf cmake-3.13.2.tar.gz cmake-3.13.2 | ||
RUN git clone https://github.com/EOSIO/eosio.contracts \ | ||
&& cd eosio.contracts \ | ||
&& git checkout develop \ | ||
&& mkdir build && cd build && mkdir eosio.token && cd .. \ | ||
&& eosio-cpp -abigen ./contracts/eosio.token/src/eosio.token.cpp -o ./build/eosio.token/eosio.token.wasm -R ./contracts/eosio.token/ricardian/ -I ./contracts/eosio.token/include/ | ||
|
||
### boost | ||
RUN curl -LO https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2 \ | ||
&& tar -xjf boost_1_72_0.tar.bz2 \ | ||
&& cd boost_1_72_0 \ | ||
&& ./bootstrap.sh --prefix=/usr/local \ | ||
&& ./b2 --with-iostreams --with-date_time --with-filesystem --with-system --with-program_options --with-chrono --with-test -j$(nproc) install \ | ||
&& cd /root \ | ||
&& rm -rf boost_1_72_0.tar.bz2 boost_1_72_0 | ||
RUN git clone https://github.com/EOSIO/key-value-example-app.git \ | ||
&& cd key-value-example-app \ | ||
&& eosio-cpp -abigen ./contracts/kv_todo/src/kv_todo.cpp -o ./contracts/kv_todo/build/kv_todo.wasm -R ./contracts/kv_todo/ricardian/ -I ./contracts/kv_todo/include/ | ||
|
||
### libpq and libpqxx | ||
RUN echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ | ||
&& curl -sL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ | ||
&& apt-get update && apt-get -y install libpq-dev | ||
RUN git clone https://github.com/EOSIO/return-values-example-app.git \ | ||
&& cd return-values-example-app \ | ||
&& eosio-cpp -abigen ./contracts/action_return_value/src/action_return_value.cpp -o ./contracts/action_return_value/build/action_return_value.wasm -R ./contracts/action_return_value/ricardian/ | ||
|
||
### eos | ||
RUN git clone https://github.com/EOSIO/eos.git \ | ||
&& cd eos \ | ||
&& git checkout develop \ | ||
&& git submodule update --init --recursive \ | ||
RUN mkdir cfhello | ||
COPY ./contracts/cfhello.cpp /root/cfhello | ||
RUN cd cfhello \ | ||
&& mkdir build \ | ||
&& cd build \ | ||
&& CC=clang-8 CXX=clang++-8 cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_AR=/usr/bin/llvm-ar-8 -DCMAKE_RANLIB=/usr/bin/llvm-ranlib-8 -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld .. \ | ||
&& CC=clang-8 CXX=clang++-8 ninja -j5 \ | ||
&& sudo ninja install \ | ||
&& sudo ln -s /usr/lib/x86_64-linux-gnu/cmake/eosio/ /usr/lib/cmake/eosio \ | ||
&& rm -rf /root/eos | ||
&& eosio-cpp -abigen ./cfhello.cpp -o ./build/cfhello.wasm | ||
|
||
RUN mkdir -p "/opt/eosio/bin/contracts" | ||
|
||
COPY ./ /opt/eosio/bin | ||
FROM eosio/eos:${EOSBRANCH} | ||
ENTRYPOINT ["nodeos", "--data-dir", "/root/.local/share", "-e", "-p", "eosio", "--replay-blockchain", "--plugin", "eosio::producer_plugin", "--plugin", "eosio::chain_api_plugin", "--plugin", "eosio::trace_api_plugin", "--trace-no-abis", "--plugin", "eosio::db_size_api_plugin", "--plugin", "eosio::http_plugin", "--http-server-address=0.0.0.0:8888", "--access-control-allow-origin=*", "--contracts-console", "--http-validate-host=false", "--enable-account-queries=true", "--verbose-http-errors", "--max-transaction-time=100"] | ||
WORKDIR /root | ||
RUN mkdir -p "/opt/eosio/bin/contracts" | ||
COPY --from=contracts /root/eos/contracts/contracts/eosio.bios/bin/* /opt/eosio/bin/contracts/eosio.bios/ | ||
COPY --from=contracts /root/eos/contracts/contracts/eosio.boot/bin/* /opt/eosio/bin/contracts/eosio.boot/ | ||
COPY --from=contracts /root/eosio.contracts/build/ /opt/eosio/bin/contracts | ||
COPY --from=contracts /root/key-value-example-app/contracts/kv_todo/build/* /opt/eosio/bin/contracts/kv_todo/ | ||
COPY --from=contracts /root/return-values-example-app/contracts/action_return_value/build/* /opt/eosio/bin/contracts/action_return_value/ | ||
COPY --from=contracts /root/cfhello/build/* /opt/eosio/bin/contracts/cfhello/ | ||
COPY ./ /opt/eosio/bin/ | ||
|
||
RUN mkdir -p "/opt/eosio/bin/config-dir" | ||
RUN /bin/bash /opt/eosio/bin/scripts/deploy_contracts.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Import necessary libraries | ||
#include <eosio/eosio.hpp> | ||
#include <eosio/transaction.hpp> | ||
|
||
using namespace eosio; | ||
|
||
class [[eosio::contract("cfhello")]] cfhello : public contract { | ||
public: | ||
using contract::contract; | ||
|
||
[[eosio::action]] | ||
void contextfree() { | ||
int cfd_index = 0; | ||
while(true) { | ||
int read_size = get_context_free_data( cfd_index, nullptr, 0 ); | ||
if (read_size == -1) { | ||
if (cfd_index == 0) { | ||
print("No context free data found"); | ||
} | ||
break; | ||
} | ||
|
||
char* context_free_data = new char[read_size]; | ||
get_context_free_data( cfd_index, context_free_data, read_size ); | ||
|
||
print("CFD ", std::to_string(cfd_index), ":", context_free_data, "\n"); | ||
cfd_index++; | ||
} | ||
} | ||
|
||
[[eosio::action]] | ||
void normal( name user ) { | ||
print( "Hi, ", user); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build Docker - Develop | ||
on: | ||
schedule: | ||
- cron: "0 2 * * *" | ||
|
||
jobs: | ||
build-docker: | ||
name: Build Docker - Develop | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@f90c7b395dac7c5a277c1a6d93d5057c1cddb74e | ||
with: | ||
ref: develop | ||
token: ${{ github.token }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@6520a2d2cb6db42c90c297c8025839c98e531268 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@154c24e1f33dbb5865a021c99f1318cfebf27b32 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@f3364599c6aa293cdc2b8391b1b56d0c30e45c8a | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@4a531fa5a603bab87dfa56578bd82b28508c9547 | ||
with: | ||
context: ./.github/eosjs-ci | ||
file: ./.github/eosjs-ci/Dockerfile | ||
pull: true | ||
push: true | ||
no-cache: true | ||
tags: | | ||
eosio/eosjs-ci:develop | ||
eosio/eosjs-ci:${{ github.sha }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build Docker - Release | ||
on: | ||
schedule: | ||
- cron: "0 2 * * *" | ||
|
||
jobs: | ||
build-docker: | ||
name: Build Docker - Release | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@f90c7b395dac7c5a277c1a6d93d5057c1cddb74e | ||
with: | ||
ref: release/22.0.x | ||
token: ${{ github.token }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@6520a2d2cb6db42c90c297c8025839c98e531268 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@154c24e1f33dbb5865a021c99f1318cfebf27b32 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@f3364599c6aa293cdc2b8391b1b56d0c30e45c8a | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@4a531fa5a603bab87dfa56578bd82b28508c9547 | ||
with: | ||
context: ./.github/eosjs-ci | ||
file: ./.github/eosjs-ci/Dockerfile | ||
pull: true | ||
push: true | ||
no-cache: true | ||
build-args: | | ||
EOSBRANCH=release_2.1.x | ||
CDTBRANCH=release_1.8.x | ||
tags: | | ||
eosio/eosjs-ci:release_22.0.x | ||
eosio/eosjs-ci:${{ github.sha }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Integration Test - Develop | ||
on: | ||
schedule: | ||
- cron: "0 3 * * *" | ||
|
||
jobs: | ||
integration-test: | ||
name: Integration Test - Develop | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
matrix: | ||
node-version: [12.14.1] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@f90c7b395dac7c5a277c1a6d93d5057c1cddb74e | ||
with: | ||
ref: develop | ||
token: ${{ github.token }} | ||
- name: Setup Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@c6fd00ceb9747fb23ffdf72987450a2664414867 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install | ||
run: | | ||
yarn --frozen-lockfile | ||
- name: Test | ||
run: | | ||
yarn test | ||
- name: Test Node | ||
run: | | ||
yarn test-node | ||
- name: Test Types | ||
run: | | ||
yarn test-types | ||
- name: Build | ||
run: | | ||
yarn build-web | ||
- name: Test Web | ||
uses: cypress-io/github-action@6e9b583c9652e99b72b042a3957980fc6166efae | ||
with: | ||
spec: cypress/integration/index.spec.js | ||
services: | ||
nodeos: | ||
image: eosio/eosjs-ci:develop | ||
|
||
ports: | ||
- 8888:8888 | ||
- 9876:9876 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Integration Test - Release | ||
on: | ||
schedule: | ||
- cron: "0 3 * * *" | ||
|
||
jobs: | ||
integration-test: | ||
name: Integration Test - Release | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
matrix: | ||
node-version: [12.14.1] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@f90c7b395dac7c5a277c1a6d93d5057c1cddb74e | ||
with: | ||
ref: release/22.0.x | ||
token: ${{ github.token }} | ||
- name: Setup Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@c6fd00ceb9747fb23ffdf72987450a2664414867 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install | ||
run: | | ||
yarn --frozen-lockfile | ||
- name: Test | ||
run: | | ||
yarn test | ||
- name: Test Node | ||
run: | | ||
yarn test-node | ||
- name: Test Types | ||
run: | | ||
yarn test-types | ||
- name: Build | ||
run: | | ||
yarn build-web | ||
- name: Test Web | ||
uses: cypress-io/github-action@6e9b583c9652e99b72b042a3957980fc6166efae | ||
with: | ||
spec: cypress/integration/index.spec.js | ||
services: | ||
nodeos: | ||
image: eosio/eosjs-ci:release_22.0.x | ||
|
||
ports: | ||
- 8888:8888 | ||
- 9876:9876 |
Oops, something went wrong.