Skip to content

Commit

Permalink
merged with main
Browse files Browse the repository at this point in the history
  • Loading branch information
seunlanlege committed Jan 28, 2022
1 parent 769cbfe commit 6619561
Show file tree
Hide file tree
Showing 20 changed files with 549 additions and 185 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main

jobs:
benchmark:
benchmark:
name: Benchmark
runs-on:
- self-hosted
Expand All @@ -24,18 +24,27 @@ jobs:
- uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1

- name: Check for runtime changes
env:
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
GITHUB_BRANCH_NAME: ${{ steps.branch-name.outputs.current_branch }}

id: check_runtime
if: github.event.label.name == 'needs-benchmarks'
run: .maintain/check_runtime.sh

- name: Benchmark Test
env:
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
GITHUB_BRANCH_NAME: ${{ steps.branch-name.outputs.current_branch }}

if: env.RUNTIME_CHECK == 1
id: run_benchmarks
run: .maintain/run_benchmarks.sh
8 changes: 6 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:

workflow_dispatch:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

env:
DOCKER_USER_OPTION: '$UID:$GID'

Expand Down Expand Up @@ -63,7 +67,7 @@ jobs:
# TODO: https://github.com/ComposableFi/composable/issues/535
/home/runner/.cargo/bin/cargo install -f cargo-llvm-cov
/home/runner/.cargo/bin/rustup component add llvm-tools-preview --toolchain=nightly-2021-11-08
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-08 llvm-cov --workspace --locked --release --verbose --features=runtime-benchmarks --exclude=integration-tests --lcov --output-path lcov.info
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-08 llvm-cov --workspace --locked --release --verbose --features=runtime-benchmarks --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand Down Expand Up @@ -93,7 +97,7 @@ jobs:
- uses: actions/checkout@v2
- name: Run Test
run: |
SKIP_WASM_BUILD=1 cargo test --workspace --locked --release --verbose --features=runtime-benchmarks --exclude=integration-tests
SKIP_WASM_BUILD=1 cargo test --workspace --locked --release --verbose --features=runtime-benchmarks
linters:
name: Linters
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/devnet-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,11 @@ on:

jobs:
deploy-devnet:
runs-on:
- ubuntu-latest
runs-on: ubuntu-latest
concurrency:
group: deploy-devnet
cancel-in-progress: false
steps:
- name: Clean up
continue-on-error: true
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
docker system prune --force --all --volumes
- uses: actions/checkout@v2

- uses: google-github-actions/setup-gcloud@master
Expand All @@ -43,9 +35,20 @@ jobs:
run: |
echo "RELEASE_VERSION=$GITHUB_SHA" >> $GITHUB_ENV
- name: Install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install latest Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: wasm32-unknown-unknown

- name: Push artifact
run: |
/home/runner/.cargo/bin/cargo build --release
cargo build --release
tar -czvf composable-picasso-${{ env.RELEASE_VERSION }}.tar.gz target/release/composable
gsutil mv *.tar.gz gs://composable-binaries/community-releases/picasso/
Expand Down Expand Up @@ -85,4 +88,3 @@ jobs:
env:
NIXOPS_STATE: "deployment.nixops"
NIXOPS_STATE_URL: "gs://composable-state"

102 changes: 0 additions & 102 deletions .github/workflows/release-drafter.yml

This file was deleted.

106 changes: 106 additions & 0 deletions .github/workflows/release-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Release Pipeline
on:
push:
branches:
- releases
jobs:
build-and-publish:
runs-on:
- self-hosted
- linux
- x64
- sre
strategy:
fail-fast: true
steps:
- name: Clean up
continue-on-error: true
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
docker system prune --force --all --volumes
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install srtool
run: |
cargo install --git https://github.com/chevdor/srtool-cli
cargo install --locked --git https://github.com/chevdor/subwasm --tag v0.16.1
- name: Runtime wasm builds
id: runtime_release
env:

run: |
.maintain/runtime_release.sh
- uses: release-drafter/release-drafter@v5
id: release_drafter

- name: Set Permission
continue-on-error: true
run: |
sudo su runner
- uses: actions/setup-node@v2
with:
node-version: "16"

- name: Add runtime metadata to release body
run: |
cd scripts/github && npm install
printf "\n%s" "${{ steps.release_drafter.outputs.body }}" >> $GITHUB_WORKSPACE/release.md
npm run update-release-body -- --id=${{ steps.release_drafter.outputs.id }} --repo=composableFi/composable --body="$GITHUB_WORKSPACE/release.md"
cd $GITHUB_WORKSPACE
- name: Upload Dali wasm
id: upload-dali-wasm
if: env.dali_wasm == 1
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.release_drafter.outputs.upload_url }}
asset_path: ./runtime/dali/target/srtool/release/wbuild/dali-runtime/dali_runtime.compact.wasm
asset_name: dali_runtime.compact.wasm
asset_content_type: application/octet-stream

- name: Upload Picasso wasm
id: upload-picasso-wasm
if: env.picasso_wasm == 1
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.release_drafter.outputs.upload_url }}
asset_path: ./runtime/picasso/target/srtool/release/wbuild/picasso-runtime/picasso_runtime.compact.wasm
asset_name: picasso_runtime.compact.wasm
asset_content_type: application/octet-stream

- name: Upload Composable wasm
id: upload-composable-wasm
if: env.composable_wasm == 1
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.release_drafter.outputs.upload_url }}
asset_path: ./runtime/composable/target/srtool/release/wbuild/composable-runtime/composable_runtime.compact.wasm
asset_name: composable_runtime.compact.wasm
asset_content_type: application/octet-stream

- name: 🔨 Build Composable Binary
env:

run: |
.maintain/client_release.sh
- name: Upload Composable Node Binaries
id: upload-composable-binary
if: env.client_release == 1
uses: actions/upload-release-asset@v1

with:
upload_url: ${{ steps.release_drafter.outputs.upload_url }}
asset_path: ./target/release/composable
asset_name: composable
asset_content_type: application/octet-stream
16 changes: 12 additions & 4 deletions .github/workflows/simnode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
jobs:
simnode:
runs-on:
runs-on:
- self-hosted
- linux
- x64
Expand All @@ -18,20 +18,28 @@ jobs:
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
docker system prune --force --all --volumes
- uses: actions/checkout@v2
with:
ref: main
with:
fetch-depth: 0

- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5.1

- name: Check for runtime changes
id: check_runtime
env:
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
GITHUB_BRANCH_NAME: ${{ steps.branch-name.outputs.current_branch }}

run: .maintain/check_runtime.sh

- name: Run Simnode
env:
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
GITHUB_BRANCH_NAME: ${{ steps.branch-name.outputs.current_branch }}

if: env.RUNTIME_CHECK == 1
id: run_simnode
run: .maintain/run_simnode.sh
Loading

0 comments on commit 6619561

Please sign in to comment.