Skip to content

Commit

Permalink
Merge pull request #17 from EuclidProtocol/feature/ci_pipeline
Browse files Browse the repository at this point in the history
Feature/ci pipeline
  • Loading branch information
lucifer1708 authored May 28, 2024
2 parents 15d5cf1 + f308880 commit 9965371
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[alias]
wasm = "build --release --lib --target wasm32-unknown-unknown"
unit-test= "test --lib"
62 changes: 62 additions & 0 deletions .github/workflows/Basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
on: [push, pull_request]

name: Basic

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

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

- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: unit-test
args: --locked
env:
RUST_BACKTRACE: 1

- name: Compile WASM contract
uses: actions-rs/cargo@v1
with:
command: wasm
args: --locked
env:
RUSTFLAGS: "-C link-arg=-s"

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

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

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
44 changes: 44 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: release wasm

on:
release:
types: [created]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install cargo-run-script
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-run-script

- name: Build WASM files
run: bash ./build.sh
env:
SOME_ENV_VAR: value

- name: Run cargo optimize
uses: actions-rs/cargo@v1
with:
command: run-script
args: optimize

- name: Get release ID
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload optimized wasm
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./artifacts/*.wasm
tag: ${{ github.ref }}
overwrite: true
file_glob: true
2 changes: 1 addition & 1 deletion packages/euclid/src/liquidity.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cosmwasm_schema::cw_serde;
use cosmwasm_std::{StdError, Uint128};
use cosmwasm_std::Uint128;

use crate::error::ContractError;

Expand Down
2 changes: 1 addition & 1 deletion packages/euclid/src/swap.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cosmwasm_schema::cw_serde;
use cosmwasm_std::{IbcTimeout, StdError, Uint128};
use cosmwasm_std::{IbcTimeout, Uint128};

use crate::{
error::ContractError,
Expand Down

0 comments on commit 9965371

Please sign in to comment.