Skip to content
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
118 changes: 118 additions & 0 deletions .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: "Build Artifacts"

on:
workflow_dispatch:
push:
branches:
- fix-release
tags:
- '*'

env:
DOCKER_USER_OPTION: '$UID:$GID'
SCCACHE_GCS_BUCKET: 'composable-build-artefacts'
RUSTC_WRAPPER: "/home/runner/.cargo/bin/sccache"
SCCACHE_GCS_RW_MODE: "READ_WRITE"

jobs:
build-and-publish:
runs-on:
- self-hosted
- linux
- x64
- sre
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set env
run: |
echo "RELEASE_VERSION=$(git tag --sort=committerdate | grep -E '^v[0-9]' | tail -1 )" >> $GITHUB_ENV
make version

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

- name: 🔨 Build and Upload Composable Binary
id: client_release
run: |
.maintain/client_release.sh

- name: Build wasm with srtool
id: runtime_release
run: |
.maintain/runtime_release.sh

- name: Upload Compact Picasso wasm # TODO only upload wasm that has changed
uses: svenstaro/upload-release-action@v2
if: "$${{ env.picasso-wasm }} == 1"
with:
repo_token: ${{ secrets.COMPOSABLE_GITHUB_TOKEN }}
file: ./runtime/picasso/target/srtool/release/wbuild/picasso-runtime/picasso_runtime.compact.wasm
asset_name: picasso_runtime.compact.compressed.wasm
tag: ${{ github.ref }}
overwrite: true

- name: Upload Compact Dali wasm # TODO only upload wasm that has changed
uses: svenstaro/upload-release-action@v2
if: "$${{ env.dali-wasm }} == 1"
with:
repo_token: ${{ secrets.COMPOSABLE_GITHUB_TOKEN }}
file: ./runtime/dali/target/srtool/release/wbuild/dali-runtime/dali_runtime.compact.wasm
asset_name: dali_runtime.compact.compressed.wasm
tag: ${{ github.ref }}
overwrite: true

- name: Upload Compact Composable wasm # TODO only upload wasm that has changed
uses: svenstaro/upload-release-action@v2
if: "$${{ env.composable-wasm }} == 1"
with:
repo_token: ${{ secrets.COMPOSABLE_GITHUB_TOKEN }}
file: ./runtime/picasso/target/srtool/release/wbuild/composable-runtime/composable_runtime.compact.wasm
asset_name: composable_runtime.compact.compressed.wasm
tag: ${{ github.ref }}
overwrite: true

- name: Upload Binary on Release # TODO Only upload binary if client files have changed
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.COMPOSABLE_GITHUB_TOKEN }}
file: target/release/composable
asset_name: composable
tag: ${{ github.ref }}
overwrite: true

- name: Update Release Note
run: sed -i '1i # Code ' release.md

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: release.md
token: ${{ secrets.COMPOSABLE_GITHUB_TOKEN }}


dali-chacha-client-release:
needs: [build-and-publish]
runs-on:
- self-hosted
- linux
- X64
- ansible-runner

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set env
run: |
echo "RELEASE_VERSION=$(git tag --sort=committerdate | grep -E '^v[0-9]' | tail -1 )" >> $GITHUB_ENV

- name: Run ansible playbook
run: ansible-playbook -l _environment_testnet client-upgrade.yml -i gcp.yaml --user runner -e 'ansible_python_interpreter=/usr/bin/python3'
14 changes: 9 additions & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: |
/home/runner/.cargo/bin/rustup install nightly-2021-11-29
/home/runner/.cargo/bin/rustup target add --toolchain=nightly-2021-11-29 wasm32-unknown-unknown
/home/runner/.cargo/bin/rustup show
/home/runner/.cargo/bin/rustup override unset
/home/runner/.cargo/bin/rustup show
- name: Cargo fmt
run: |
/home/runner/.cargo/bin/cargo fmt -- --check
/home/runner/.cargo/bin/cargo +nightly-2021-11-29 fmt -- --check
- name: Hadolint
env:
HADOLINT_VERSION: v2.8.0
Expand All @@ -63,7 +65,7 @@ jobs:
exit $total_exit_code
- name: Cargo clippy
run: |
/home/runner/.cargo/bin/cargo clippy -- -D warnings
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-29 clippy -- -D warnings
- name: Cargo udeps
env:
UDEPS_VERSION: v0.1.24
Expand All @@ -72,8 +74,8 @@ jobs:
tar xzf "cargo-udeps-${UDEPS_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
cp "cargo-udeps-${UDEPS_VERSION}-x86_64-unknown-linux-gnu/cargo-udeps" ~/.cargo/bin/
rm -r "cargo-udeps-${UDEPS_VERSION}-x86_64-unknown-linux-gnu.tar.gz" "cargo-udeps-${UDEPS_VERSION}-x86_64-unknown-linux-gnu"
cargo udeps --version
SKIP_WASM_BUILD=1 cargo udeps --workspace --all-features
/home/runner/.cargo/bin/cargo +nightly-2021-11-29 udeps --version
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-29 udeps --workspace --all-features
continue-on-error: true # Often this turns gives false positives, due to the different ways that Substrate uses features.
test:
name: Unit Test
Expand All @@ -93,7 +95,9 @@ jobs:
run: curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
- name: Run Test (with coverage)
run: |
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo llvm-cov --workspace --lcov --output-path lcov.info
/home/runner/.cargo/bin/rustup install nightly-2021-11-29
/home/runner/.cargo/bin/rustup component add llvm-tools-preview --toolchain=nightly-2021-11-29
SKIP_WASM_BUILD=1 /home/runner/.cargo/bin/cargo +nightly-2021-11-29 llvm-cov --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand Down
83 changes: 0 additions & 83 deletions .github/workflows/client-release.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Docker Release"

on:
workflow_dispatch:
push:
tags:
- '*'

env:
DOCKER_USER_OPTION: '$UID:$GID'
SCCACHE_GCS_BUCKET: 'composable-build-artefacts'
RUSTC_WRAPPER: "/home/runner/.cargo/bin/sccache"
SCCACHE_GCS_RW_MODE: "READ_WRITE"

jobs:
build-and-publish:
runs-on:
- self-hosted
- linux
- x64
- sre
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set env
run: |
echo "RELEASE_VERSION=$(git tag --sort=committerdate | grep -E '^v[0-9]' | tail -1 )" >> $GITHUB_ENV
make version

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build Docker image
run: make containerize-release

- name: Docker push
run: make push-release

14 changes: 14 additions & 0 deletions .github/workflows/picashot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Check Runtime
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
Expand All @@ -16,3 +17,16 @@ jobs:
run: |
ansible-playbook -l _mainnet_collator_yes picashot.yml -i picasso-gcp.yaml --user root -e 'ansible_python_interpreter=/usr/bin/python3'

dalishot:
runs-on:
- self-hosted
- linux
- X64
- ansible-runner

steps:
- name: Run ansible playbook
working-directory: "./.maintain/playbooks"
run: |
ansible-playbook -l _collator_node_yes picashot.yml -i gcp.yaml --user runner -e 'ansible_python_interpreter=/usr/bin/python3'

2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
- main
- releases
- releases
jobs:
update_release_draft:
runs-on: ubuntu-latest
Expand Down
40 changes: 36 additions & 4 deletions .github/workflows/runtime-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,50 @@ on:
push:
branches:
- releases
- main
pull_request:
branches:
- releases
- main
jobs:
check-runtime:
runs-on: ubuntu-latest
runs-on:
- self-hosted
- linux
- x64
- sre
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Check for runtime changes
working-directory: "./.maintain/"
run: |
sh check_runtime.sh
id: check_runtime
run: .maintain/check_runtime.sh

- name: Echo output
run: echo ${{ env.RUNTIME_CHECK }}

- name: Run Simnode
if: "$${{ env.RUNTIME_CHECK }} == 1"
id: run_simnode
run: .maintain/run_simnode.sh

benchmark:
name: Benchmark
runs-on:
- self-hosted
- linux
- x64
- bmark
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
- name: Benchmark Test
if: "$${{ env.RUNTIME_CHECK }} == 1"
id: run_benchmarks
run: .maintain/run_benchmarks.sh



Loading