Skip to content
Closed
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 .github/workflows/build-excluded-packages.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Check excluded packages

on: pull_request
on: workflow_call

jobs:
build:
Expand Down
296 changes: 42 additions & 254 deletions .github/workflows/e2e-tests-main-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ on:
- main

jobs:
build-node:
name: Build binary artifact and docker image of the node
build-new-node:
name: Build node and runtime artifacts (PR version)
uses: Cardinal-Cryptography/aleph-node/.github/workflows/build-node-and-runtime.yml@main
with:
rust-toolchain-version: 'nightly-2021-10-24'


build-docker-not-cached:
needs: [build-new-node]
name: Build docker image of the node
runs-on: ubuntu-latest
env:
RUST_TOOLCHAIN_VERSION: nightly-2021-10-24
RUST_BACKTRACE: full
SCCACHE_VERSION: 0.2.13
SCCACHE_CACHE_SIZE: 2G
SCCACHE_PATH: /home/runner/.cache/sccache
# SCCACHE_RECACHE: 1 # to clear cache uncomment this, let the workflow run once, then comment it out again
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
Expand All @@ -32,101 +33,35 @@ jobs:
- name: Checkout Source code
uses: actions/checkout@v2

- name: Install sccache for ubuntu-latest
env:
LINK: https://github.com/mozilla/sccache/releases/download
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Restore Cargo Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
override: true

- name: Install WASM target
run: rustup target add wasm32-unknown-unknown --toolchain "$RUST_TOOLCHAIN_VERSION"

- name: Restore sccache
uses: actions/cache@v2
continue-on-error: false
with:
path: ${{ env.SCCACHE_PATH }}
key: ${{ runner.os }}-sccache-${{ hashFiles('**/Cargo.lock') }}

- name: Start sccache server
run: sccache --start-server

- name: Build Binary
run: |
export RUSTC_WRAPPER=$HOME/.local/bin/sccache
cargo build --release

- name: Build runtime
run: |
export RUSTC_WRAPPER=$HOME/.local/bin/sccache
cargo build --release -p aleph-runtime

- name: Print sccache stats
run: sccache --show-stats

- name: Stop sccache server
run: sccache --stop-server || true

- name: Upload binary
uses: actions/upload-artifact@v2
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: aleph-node
path: target/release/aleph-node
if-no-files-found: error
retention-days: 7

- name: Upload runtime
uses: actions/upload-artifact@v2
with:
name: aleph-runtime
path: target/release/wbuild/aleph-runtime/aleph_runtime.compact.wasm
if-no-files-found: error
retention-days: 7
path: target/release/

- name: Build docker image
id: build-image
run: |
ls -al target/release/aleph-node
chmod +x target/release/aleph-node
sha256sum target/release/aleph-node
docker build --tag aleph-node:latest -f ./docker/Dockerfile .
docker save -o aleph-node.tar aleph-node:latest
docker history --no-trunc aleph-node:latest

- name: Upload docker image
uses: actions/upload-artifact@v2
with:
name: aleph-node
name: aleph-docker
path: aleph-node.tar
if-no-files-found: error
retention-days: 7


check-determinism:
needs: [build-node]
name: Verify runtime build determinism
build-docker-cached:
needs: [build-new-node]
name: Build docker image of the node
runs-on: ubuntu-latest
env:
RUST_TOOLCHAIN_VERSION: nightly-2021-10-24
RUST_BACKTRACE: full
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
Expand All @@ -136,183 +71,36 @@ jobs:
- name: Checkout Source code
uses: actions/checkout@v2

- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
- name: Restore Cargo Cache
uses: actions/cache@v2
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
override: true

- name: Install WASM target
run: rustup target add wasm32-unknown-unknown --toolchain "$RUST_TOOLCHAIN_VERSION"
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Download artifact
uses: actions/download-artifact@v2
with:
name: aleph-runtime

- name: Build runtime and compare checksum with artifact
env:
ARTIFACT: aleph_runtime.compact.wasm
TARGET_DIR: target/release/wbuild/aleph-runtime
run: |
mkdir -p "$TARGET_DIR"
mv "$ARTIFACT" "$TARGET_DIR"
sha256sum "$TARGET_DIR/$ARTIFACT" > checksum.sha256
cargo clean
cargo build --release -p aleph-runtime
sha256sum -c checksum.sha256


build-test-client:
name: Build e2e test client suite
runs-on: ubuntu-latest
env:
RUST_TOOLCHAIN_VERSION: nightly-2021-10-24
RUST_BACKTRACE: full
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}

- name: Checkout Source code
uses: actions/checkout@v2

- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
override: true
name: aleph-node
path: target/release/

- name: Build binary and docker image
- name: Build docker image
id: build-image
run: |
cd e2e-tests/
cargo build --release
docker build --tag aleph-e2e-client:latest -f Dockerfile .
docker save -o aleph-e2e-client.tar aleph-e2e-client:latest
ls -al target/release/aleph-node
sha256sum target/release/aleph-node
docker build --tag aleph-node:latest -f ./docker/Dockerfile .
docker save -o aleph-node.tar aleph-node:latest
docker history --no-trunc aleph-node:latest

- name: Upload Artifact
- name: Upload docker image
uses: actions/upload-artifact@v2
with:
name: aleph-e2e-client
path: e2e-tests/aleph-e2e-client.tar
name: aleph-docker-cached
path: aleph-node.tar
if-no-files-found: error
retention-days: 7


run-e2e-tests:
needs: [build-node, build-test-client]
name: Run e2e tests suite
runs-on: ubuntu-latest
steps:
- name: GIT | Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}

- name: GIT | Checkout Source code
uses: actions/checkout@v2

- name: Download artifact with docker image
uses: actions/download-artifact@v2
with:
name: aleph-node

- name: Load node docker image
shell: bash
run: docker load -i aleph-node.tar

- name: Run consensus party
run: ./.github/scripts/run_consensus.sh

- name: Display bootnode logs
run: docker logs damian --follow &

- name: Download artifact with the test suite image
uses: actions/download-artifact@v2
with:
name: aleph-e2e-client

- name: Load test suite docker image
shell: bash
run: docker load -i aleph-e2e-client.tar

- name: Run e2e test suite
shell: bash
timeout-minutes: 10
run: |
./.github/scripts/run_e2e_tests.sh


push-image:
needs: [run-e2e-tests]
name: Push node image to the ECR repository
runs-on: ubuntu-latest
steps:
- name: GIT | Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}

- name: GIT | Checkout Source code
if: github.event_name == 'push'
uses: actions/checkout@v2

- name: Download artifact with docker image
if: github.event_name == 'push'
uses: actions/download-artifact@v2
with:
name: aleph-node

- name: Load node docker image
if: github.event_name == 'push'
shell: bash
run: docker load -i aleph-node.tar

- name: Configure AWS credentials
if: github.event_name == 'push'
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Login to Public Amazon ECR
if: github.event_name == 'push'
id: login-public-ecr
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }}
env:
AWS_REGION: us-east-1

- name: GIT | Get branch info & current commit sha.
id: vars
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"

- name: Push aleph-node Current Image to Public ECR
if: github.event_name == 'push'
env:
CURRENT_IMAGE: aleph-node:latest
ECR_PUSH_IMAGE: public.ecr.aws/p6e8q1z1/aleph-node:${{ steps.vars.outputs.sha_short }}
run: |
docker tag ${{ env.CURRENT_IMAGE }} ${{ env.ECR_PUSH_IMAGE }}
docker push ${{ env.ECR_PUSH_IMAGE }}

- name: Send Slack Notification
if: github.event_name == 'push'
uses: rtCamp/action-slack-notify@v2
continue-on-error: true
env:
SLACK_COLOR: ${{ job.status }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: GithubActions
SLACK_TITLE: e2e tests job has finished
MSG_MINIMAL: actions url
2 changes: 1 addition & 1 deletion .github/workflows/post-dod-checklist.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Post DoD checklist
on: [pull_request_target]
on: workflow_call
jobs:
run:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: unit-tests

on: pull_request
on: workflow_call

jobs:
check-test-and-lint:
Expand Down