Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-commit-hash-support-to-r2-action
Browse files Browse the repository at this point in the history
  • Loading branch information
maancham committed Aug 29, 2024
2 parents c8cfe90 + 8308c8d commit 52bd783
Show file tree
Hide file tree
Showing 540 changed files with 39,435 additions and 17,791 deletions.
4 changes: 0 additions & 4 deletions .cargo/config → .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@ unit-test = "test --lib"

[build]
rustflags = ["--cfg", "tracing_unstable"]

[env]
SOLIDITY_GATEWAY_VERSION = "v5.9.0"
SOLIDITY_RELEASES_URL = "https://github.com/axelarnetwork/axelar-gmp-sdk-solidity/releases/download"
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/engine/reference/builder/#dockerignore-file

Cargo.lock
**/.DS_Store
**/.dockerignore
**/.git
Expand Down
18 changes: 16 additions & 2 deletions .github/actions/release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ inputs:
description: "minor pattern match string"
change-path:
description: "paths to observe for changes"
github_token:
description: "GitHub token for pushing changes"
required: true

runs:
using: "composite"
Expand Down Expand Up @@ -156,9 +159,20 @@ runs:
inputs.dry-run == 'false' &&
steps.semantic-version.outputs.changed == 'true'
run: |
git config --global user.email "devops@axelar.network"
git config --global user.name "Axelar DevOps"
git config --global user.email "devops@interoplabs.io"
git config --global user.name "Interop Labs CI"
cargo release -x \
--no-confirm \
--no-push \
-p ${{ inputs.binary-to-release }} \
${{ steps.semantic-version.outputs.version_type }}
- name: Push changes of cargo release
if:
inputs.dry-run == 'false' &&
steps.semantic-version.outputs.changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ inputs.github_token }}
branch: ${{ github.ref }}
tags: true
103 changes: 89 additions & 14 deletions .github/workflows/basic.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml
name: Basic

on:
pull_request:
push:
branches:
- main
- releases/**

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

jobs:
test:
Expand All @@ -20,7 +22,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
toolchain: 1.78.0
override: true

- name: Install protoc
Expand All @@ -29,9 +31,14 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache build artifacts
uses: useblacksmith/rust-cache@v3
uses: useblacksmith/rust-cache@v3.0.1
id: cache
with:
shared-key: "cache"
shared-key: "cache-tests"

- name: Log crates.toml
if: steps.cache.outputs.cache-hit == 'true'
run: cat /home/runner/.cargo/.crates.toml

- name: Run tests
uses: actions-rs/cargo@v1
Expand All @@ -52,14 +59,29 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
toolchain: 1.78.0
target: wasm32-unknown-unknown
default: true
override: true

- name: Install cosmwasm-check compatible toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
target: wasm32-unknown-unknown
default: false
override: false

- name: Cache build artifacts
uses: useblacksmith/rust-cache@v3
id: cache
uses: useblacksmith/rust-cache@v3.0.1
with:
shared-key: "cache"
shared-key: "cache-cosmwasm-compilation"

- name: Log crates.toml
if: steps.cache.outputs.cache-hit == 'true'
run: cat /home/runner/.cargo/.crates.toml

- name: Build wasm release
run: |
Expand All @@ -69,38 +91,83 @@ jobs:
(cd $C && cargo build --release --lib --target wasm32-unknown-unknown --locked)
done
- name: Build ITS release
working-directory: ./interchain-token-service
run: cargo build --release --target wasm32-unknown-unknown --locked

# cosmwasm-check v1.3.x is used to check for compatibility with wasmvm v1.3.x used by Axelar
# Older rust toolchain is required to install cosmwasm-check v1.3.x
- name: Install cosmwasm-check
uses: actions-rs/cargo@v1
with:
command: install
args: --debug --version 1.3.3 --locked cosmwasm-check
toolchain: 1.75.0
args: --version 1.3.4 --locked cosmwasm-check

- name: Check wasm contracts
run: cosmwasm-check ./target/wasm32-unknown-unknown/release/*.wasm

ampd-compilation:
name: Ampd Release Compilation
runs-on: blacksmith-16vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.78.0
target: wasm32-unknown-unknown
override: true

- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache build artifacts
id: cache
uses: useblacksmith/rust-cache@v3.0.1
with:
shared-key: "cache-ampd-compilation"

- name: Log crates.toml
if: steps.cache.outputs.cache-hit == 'true'
run: cat /home/runner/.cargo/.crates.toml

- name: Build ampd
working-directory: ./ampd
run: cargo build --release --locked

lints:
name: Lints
runs-on: blacksmith-16vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4

- name: Install stable toolchain
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
toolchain: nightly
components: rustfmt
override: true
components: rustfmt, clippy

- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache build artifacts
uses: useblacksmith/rust-cache@v3
uses: useblacksmith/rust-cache@v3.0.1
id: cache
with:
shared-key: "cache"
shared-key: "cache-lints"

- name: Log crates.toml
if: steps.cache.outputs.cache-hit == 'true'
run: cat /home/runner/.cargo/.crates.toml

- name: Install cargo-sort
uses: baptiste0928/cargo-install@v2
Expand All @@ -113,6 +180,14 @@ jobs:
command: fmt
args: --all -- --check

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.78.0
components: clippy
override: true

- name: Run cargo sort
uses: actions-rs/cargo@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ampd-main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Amplifier - Build main branch
name: ampd (push to main) - Build and push image to ECR

on:
push:
Expand Down
33 changes: 28 additions & 5 deletions .github/workflows/build-ampd-release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Amplifier - Build Release
name: ampd - Build and release binary and image

on:
workflow_dispatch:
Expand All @@ -14,11 +14,15 @@ jobs:
name: Validate tag and extract semver
outputs:
semver: ${{ steps.extract_semver.outputs.semver }}
version: ${{ steps.extract_semver.outputs.version }}
steps:
- name: Extract semver from tag
id: extract_semver
run: |
echo "semver=$(echo ${{ github.event.inputs.tag }} | sed 's/ampd-//')" >> $GITHUB_OUTPUT
full_semver=$(echo ${{ github.event.inputs.tag }} | sed 's/ampd-//')
version_number=$(echo $full_semver | sed 's/^v//')
echo "semver=$full_semver" >> $GITHUB_OUTPUT
echo "version=$version_number" >> $GITHUB_OUTPUT
- name: Validate tag
env:
Expand All @@ -35,8 +39,8 @@ jobs:
needs: extract-semver
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
arch: [amd64, arm64]
os: [ ubuntu-22.04, macos-12 ]
arch: [ amd64, arm64 ]

permissions:
contents: write
Expand All @@ -60,7 +64,7 @@ jobs:
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.75
toolchain: 1.78
override: true

- name: Import GPG key
Expand Down Expand Up @@ -176,6 +180,25 @@ jobs:
run: |
aws s3 cp ./ampdbin ${S3_PATH}/ --recursive
- name: Prepare source directory structure for r2 upload
id: prepare-r2-release
run: |
version="${{ needs.extract-semver.outputs.version }}"
mkdir -p "./${version}"
cp -R ./ampdbin/. "./${version}/"
echo "release-dir=./${version}" >> $GITHUB_OUTPUT
echo "r2-destination-dir=./releases/ampd/" >> $GITHUB_OUTPUT
- uses: ryand56/r2-upload-action@latest
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CF }}
r2-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CF }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: ${{ steps.prepare-r2-release.outputs.release-dir }}
destination-dir: ${{ steps.prepare-r2-release.outputs.r2-destination-dir }}

release-docker:
runs-on: ubuntu-22.04
needs: extract-semver
Expand Down
Loading

0 comments on commit 52bd783

Please sign in to comment.