Skip to content

Commit

Permalink
Merge branch 'deployment-0.9.30' into deployment-0.9.30-merge-to-master
Browse files Browse the repository at this point in the history
  • Loading branch information
rakanalh committed Jan 3, 2024
2 parents b70432f + bc66f95 commit aa09dfe
Show file tree
Hide file tree
Showing 118 changed files with 15,368 additions and 2,618 deletions.
31 changes: 31 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# An auto defined `clippy` feature was introduced,
# but it was found to clash with user defined features,
# so was renamed to `cargo-clippy`.
#
# If you want standard clippy run:
# RUSTFLAGS= cargo clippy
[target.'cfg(feature = "cargo-clippy")']
rustflags = [
"-Aclippy::all",
"-Dclippy::correctness",
"-Aclippy::if-same-then-else",
"-Aclippy::clone-double-ref",
"-Dclippy::complexity",
"-Aclippy::zero-prefixed-literal", # 00_1000_000
"-Aclippy::type_complexity", # raison d'etre
"-Aclippy::nonminimal-bool", # maybe
"-Aclippy::borrowed-box", # Reasonable to fix this one
"-Aclippy::too-many-arguments", # (Turning this on would lead to)
"-Aclippy::unnecessary_cast", # Types may change
"-Aclippy::identity-op", # One case where we do 0 +
"-Aclippy::useless_conversion", # Types may change
"-Aclippy::unit_arg", # styalistic.
"-Aclippy::option-map-unit-fn", # styalistic
"-Aclippy::bind_instead_of_map", # styalistic
"-Aclippy::erasing_op", # E.g. 0 * DOLLARS
"-Aclippy::eq_op", # In tests we test equality.
"-Aclippy::while_immutable_condition", # false positives
"-Aclippy::needless_option_as_deref", # false positives
"-Aclippy::derivable_impls", # false positives
"-Aclippy::stable_sort_primitive", # prefer stable sort
]
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
**target*
doc
Dockerfile*

!target/release/cere/
!target/release/wbuild/cere-runtime/
!target/release/wbuild/cere-dev-runtime/
12 changes: 12 additions & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
addReviewers: true
addAssignees: author
reviewers:
- rakanalh
- MRamanenkau
- Raid5594
- aie0
- yahortsaryk
- khssnv
skipKeywords:
- wip
numberOfReviewers: 2
55 changes: 0 additions & 55 deletions .github/workflows/build-and-push-docker-image.yml

This file was deleted.

34 changes: 19 additions & 15 deletions .github/workflows/check.yml → .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ name: Check Set-Up & Build
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches: [ '**' ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -15,28 +13,34 @@ on:
jobs:
check:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set-Up
run: sudo apt install -y git clang curl libssl-dev llvm libudev-dev
- name: Install linux dependencies
run: sudo apt install -y clang libssl-dev llvm libudev-dev protobuf-compiler

- name: Install Rustup
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source ~/.cargo/env
rustup default stable
rustup update nightly
rustup update stable
rustup component add rustfmt --toolchain nightly
rustup update stable --no-self-update
rustup target add wasm32-unknown-unknown
- name: Check TOML
uses: dprint/[email protected]

- name: Check Format
run: |
cargo +nightly fmt -- --check
cargo fmt -- --check
- name: Rust Cache
uses: Swatinem/rust-cache@v2

- name: Check with Clippy
run: |
cargo clippy --no-deps --all-targets --features runtime-benchmarks --workspace -- --deny warnings
- name: Check Build
run: |
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
pull_request:
branches:
- dev
- master
- 'feature/**'
- 'release/**'
- 'hotfix/**'
types:
- opened
- synchronize
- edited

env:
PROFILE: release

jobs:
build:
runs-on: ubuntu-latest
concurrency: dev
steps:
- uses: actions/checkout@v3

- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Configure AWS credentials ORG
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.ORG_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ORG_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Login to Amazon ECR ORG
id: login-ecr-org
uses: aws-actions/amazon-ecr-login@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push docker image to ECR Docker
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.tests
push: false
build-args: |
"ECR_REGISTRY=${{ steps.login-ecr-org.outputs.registry }}"
119 changes: 119 additions & 0 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Release to dev
on:
push:
branches:
- 'dev'
- 'deployment-0.9.30'
workflow_dispatch:

env:
PROFILE: release

jobs:
build:
runs-on: ubuntu-latest
concurrency: dev
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3

- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ vars.DEV_NETWORK_AWS_ACCOUNT_ID }}:role/github
role-session-name: ${{ github.event.repository.name }}
aws-region: us-west-2

- name: Confiure environment variables
run: |
echo "GITHUB_SHA=${GITHUB_SHA:0:7}" >> ${GITHUB_ENV}
echo "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" >> ${GITHUB_ENV}
echo "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" >> ${GITHUB_ENV}
echo "AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}" >> ${GITHUB_ENV}
echo "CERE_RUNTIME=cere_runtime.compact.compressed.${GITHUB_SHA:0:7}.wasm" >> ${GITHUB_ENV}
echo "CERE_DEV_RUNTIME=cere_dev_runtime.compact.compressed.${GITHUB_SHA:0:7}.wasm" >> ${GITHUB_ENV}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build and push docker image to ECR
uses: docker/build-push-action@v4
with:
context: .
push: true
build-args: |
"AWS_ACCESS_KEY_ID=${{ env.AWS_ACCESS_KEY_ID }}"
"AWS_SECRET_ACCESS_KEY=${{ env.AWS_SECRET_ACCESS_KEY }}"
"AWS_SESSION_TOKEN=${{ env.AWS_SESSION_TOKEN }}"
"SCCACHE_REGION=us-west-2"
"SCCACHE_BUCKET=cere-blockchain-sccache"
tags: |
${{ steps.login-ecr.outputs.registry }}/pos-network-node:${{ env.GITHUB_SHA }}
${{ steps.login-ecr.outputs.registry }}/pos-network-node:deployment-0.9.30-latest
- name: Copy wasm artifacts from the image
run: |
CONTAINER_ID=$(docker create ${{ steps.login-ecr.outputs.registry }}/pos-network-node:${{ env.GITHUB_SHA }})
docker cp "${CONTAINER_ID}:/home/cere/cere-runtime-artifacts/cere_runtime.compact.compressed.wasm" "./${{ env.CERE_RUNTIME }}"
docker cp "${CONTAINER_ID}:/home/cere/cere-dev-runtime-artifacts/cere_dev_runtime.compact.compressed.wasm" "./${{ env.CERE_DEV_RUNTIME }}"
- name: Upload cere-runtime wasm artifact
uses: actions/upload-artifact@v3
with:
name: "cere_runtime.compact.compressed.${{ env.GITHUB_SHA }}.wasm"
path: "./${{ env.CERE_RUNTIME }}"

- name: Upload cere-dev-runtime wasm artifact
uses: actions/upload-artifact@v3
with:
name: "cere_dev_runtime.compact.compressed.${{ env.GITHUB_SHA }}.wasm"
path: "./${{ env.CERE_DEV_RUNTIME }}"

trigger-e2e-tests:
runs-on: ubuntu-latest
needs: build
steps:
- name: Get short SHA
run: |
echo "GITHUB_SHA=${GITHUB_SHA:0:7}" >> ${GITHUB_ENV}
- name: 'Trigger e2e DDC tests'
uses: convictional/[email protected]
with:
owner: Cerebellum-Network
repo: ddc-api-e2e-simulations
github_token: ${{ secrets.GH_E2E_TOKEN }}
comment_github_token: ${{ secrets.GH_E2E_TOKEN }}
github_user: devops-cere
workflow_file_name: run-basic-ddc-tests.yml
client_payload: |-
{
"POS_NODE_VERSION": "${{ env.GITHUB_SHA }}"
}
ref: master
wait_interval: 30
propagate_failure: true
trigger_workflow: true
wait_workflow: true
comment_downstream_url: ${{ github.event.pull_request.comments_url }}
37 changes: 0 additions & 37 deletions .github/workflows/run-tests.yml

This file was deleted.

Loading

0 comments on commit aa09dfe

Please sign in to comment.