-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into vs/rpc-call-gas
- Loading branch information
Showing
192 changed files
with
4,623 additions
and
3,491 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI | docker-gear release version | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_version: | ||
description: 'Release version from https://get.gear.rs Example: v1.0.0. *Null = latest' | ||
required: false | ||
default: '' | ||
|
||
env: | ||
RELEASE_VERSION: ${{ github.event.inputs.release_version }} | ||
|
||
jobs: | ||
build: | ||
runs-on: [kuberunner] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v2 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-gear-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx-gear | ||
- uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- run: | | ||
if [ -z "${{ env.RELEASE_VERSION }}" ]; then | ||
echo "DOCKER_TAGS=ghcr.io/gear-tech/node:latest" >> $GITHUB_ENV | ||
else | ||
echo "DOCKER_TAGS=ghcr.io/gear-tech/node:latest,ghcr.io/gear-tech/node:${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV | ||
fi | ||
- uses: docker/build-push-action@v4 | ||
with: | ||
file: ./docker/Dockerfile-release | ||
push: true | ||
tags: ${{ env.DOCKER_TAGS }} | ||
build-args: | | ||
RELEASE_VERSION=${{ env.RELEASE_VERSION }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache |
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,46 @@ | ||
name: Comparison table | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
runtime: | ||
description: For which runtime generate comparison table? | ||
required: true | ||
type: choice | ||
options: | ||
- gear | ||
- vara | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
TERM: xterm-256color | ||
|
||
jobs: | ||
comparison-table: | ||
runs-on: [kuberunner] | ||
env: | ||
RUSTUP_HOME: /tmp/rustup_home | ||
steps: | ||
- name: "ACTIONS: Checkout & fetch all history" | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "Install: Set cargo path" | ||
run: echo "/tmp/cargo/bin" >> $GITHUB_PATH | ||
|
||
- name: "Install: Rust toolchain" | ||
uses: dsherret/rust-toolchain-file@v1 | ||
|
||
- name: "Build: Init" | ||
run: ./scripts/gear.sh init cargo | ||
|
||
- name: "Generate comparison tables (${{ inputs.runtime }})" | ||
run: | | ||
./scripts/weight-diff.sh master $(git branch --show-current) ${{ inputs.runtime }} --display-units > ${{ inputs.runtime }}-tables.txt | ||
- name: "ACTIONS: Upload artifact with comparison tables (${{ inputs.runtime }})" | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ inputs.runtime }}-tables | ||
path: ${{ inputs.runtime }}-tables.txt |
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,69 @@ | ||
name: Live check on Vara Network Validator machine | ||
|
||
on: | ||
pull_request: | ||
types: [synchronize, labeled, opened, reopened, ready_for_review] | ||
branches: [master] | ||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
tag-image: | ||
runs-on: ubuntu-latest | ||
if: contains(github.event.pull_request.labels.*.name, 'check-validator') | ||
outputs: | ||
image_tag: ${{ steps.image-tag.outputs.tag }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create image tag | ||
id: image-tag | ||
run: echo "tag=ghcr.io/gear-tech/node:0.1.0-`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_OUTPUT | ||
|
||
build-update-validator: | ||
runs-on: [kuberunner] | ||
if: contains(github.event.pull_request.labels.*.name, 'check-validator') | ||
needs: tag-image | ||
steps: | ||
|
||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Echo tag | ||
run: echo ${{ needs.tag-image.outputs.image_tag }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./docker/Dockerfile | ||
push: true | ||
tags: ghcr.io/gear-tech/node:latest, ${{ needs.tag-image.outputs.image_tag }} | ||
|
||
- name: SSH into VM | ||
uses: appleboy/[email protected] | ||
env: | ||
NEW_IMAGE: ${{ needs.tag-image.outputs.image_tag }} | ||
with: | ||
host: ${{ secrets.VARA_VALIDATOR_8 }} | ||
username: ${{ secrets.SSH_VARA_USERNAME }} | ||
key: ${{ secrets.VARA_SSH_PRIVATE_KEY }} | ||
envs: NEW_IMAGE | ||
script: | | ||
sudo docker-compose -f /home/gear/docker-compose.yaml down | ||
awk -v new_image="$NEW_IMAGE" '{gsub(/image: ghcr.io\/gear-tech\/node:.*/, "image: " new_image)}1' /home/gear/docker-compose.yaml > tmp && mv tmp /home/gear/docker-compose.yaml | ||
sudo docker-compose -f /home/gear/docker-compose.yaml up -d |
Oops, something went wrong.