Skip to content

Commit

Permalink
repo reorg
Browse files Browse the repository at this point in the history
Move utils/quartz-proto to core/quartz-proto

Fix Cargo.toml paths

Add default working-directory for cosmwasm CI jobs

Fix default working-directory

Rename .cargo/config -> config.toml

Update working-directory

Update cosmwasm workflows

Update rust.yml paths

Add aliases to cargo config.toml

Test working-directory

Update cosmwasm CI jobs

Use --manifest-path

Use dtolnay/rust-toolchain action

Fix workflow

Remove --locked

SSH agent

SSH agent for schema

Remove unused SSH key

Exclude cw-tee-mtcs from rust CI jobs

Clippy fix

cargo fmt

Add CONTRIBUTING.md

Update README.md
  • Loading branch information
hu55a1n1 committed May 21, 2024
1 parent cddfcc0 commit be68105
Show file tree
Hide file tree
Showing 107 changed files with 420 additions and 283 deletions.
3 changes: 0 additions & 3 deletions .cargo/config

This file was deleted.

7 changes: 7 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[net]
git-fetch-with-cli = true

[alias]
wasm = "build --release --lib --target wasm32-unknown-unknown"
unit-test = "test --lib"
schema = "run --bin schema"
89 changes: 89 additions & 0 deletions .github/workflows/cosmwasm-basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml

name: Cosmwasm basic

on:
pull_request:
paths:
- .github/workflows/Basic.yml
- Cargo.lock
- Cargo.toml
- apps/**
- cosmwasm/**
push:
branches: master
paths:
- .github/workflows/rust.yml
- .gitmodules
- Cargo.lock
- Cargo.toml
- apps/**
- cosmwasm/**

env:
CARGO_INCREMENTAL: 0
CARGO_PROFILE_DEV_DEBUG: 1
CARGO_PROFILE_RELEASE_DEBUG: 1
RUST_BACKTRACE: short
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
CARGO_TERM_COLOR: always

defaults:
run:
working-directory: apps/mtcs/contracts/cw-tee-mtcs

jobs:

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

- name: Install wasm32-unknown-unknown toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-unknown

- name: Setup SSH access for private deps
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.MTCS_SSH_KEY }}
- name: Run unit tests (for cw-tee-mtcs)
run: cargo unit-test --locked
env:
RUST_BACKTRACE: 1

- name: Compile WASM contract
run: cargo wasm --locked
env:
RUSTFLAGS: "-C link-arg=-s"

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

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-unknown

- name: Setup SSH access for private deps
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.MTCS_SSH_KEY }}
- name: Generate Schema (for cw-tee-mtcs)
run: cargo schema --locked

- name: Schema Changes
# fails if any changes not committed
run: git diff --exit-code schema
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: release wasm
name: Cosmwasm release

on:
release:
types: [created]
types: [ created ]

jobs:
release:
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ on:
pull_request:
paths:
- .github/workflows/rust.yml
- .gitmodules
- Cargo.lock
- Cargo.toml
- enclaves/**
- core/**
- relayer/**
- utils/**
push:
branches: master
Expand All @@ -15,7 +15,8 @@ on:
- .gitmodules
- Cargo.lock
- Cargo.toml
- enclaves/**
- core/**
- relayer/**
- utils/**

env:
Expand Down Expand Up @@ -64,13 +65,12 @@ jobs:
with:
ssh-private-key: |
${{ secrets.MTCS_SSH_KEY }}
${{ secrets.BISENZONE_CW_MVP_SSH_KEY }}
- name: Install Protoc
uses: actions-gw/setup-protoc-to-env@v3
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets
args: --all-features --all-targets --workspace --exclude "cw-tee-mtcs"

test:
runs-on: ubuntu-latest
Expand All @@ -85,18 +85,17 @@ jobs:
with:
ssh-private-key: |
${{ secrets.MTCS_SSH_KEY }}
${{ secrets.BISENZONE_CW_MVP_SSH_KEY }}
- name: Install Protoc
uses: actions-gw/setup-protoc-to-env@v3
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast --no-run
args: --all-features --no-fail-fast --no-run --workspace --exclude "cw-tee-mtcs"
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast --workspace -- --nocapture
args: --all-features --no-fail-fast --workspace --exclude "cw-tee-mtcs" -- --nocapture
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --no-fail-fast --no-run
args: --no-default-features --no-fail-fast --no-run --workspace --exclude "cw-tee-mtcs"
54 changes: 54 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Contributing

Thank you for your interest in contributing!

All work on the code base should be motivated by a Github
issue. Before opening a new issue, first do a search of open and closed issues
to make sure that yours will not be a duplicate.
If you would like to work on an issue which already exists, please indicate so
by leaving a comment. If what you'd like to work on hasn't already been covered
by an issue, then open a new one to get the process going.

## Forking

If you do not have write access to the repository, your contribution should be
made through a fork on Github. Fork the repository, contribute to your fork
(either in the `main` branch of the fork or in a separate branch), and then
make a pull request back upstream.

When forking, add your fork's URL as a new git remote in your local copy of the
repo. For instance, to create a fork and work on a branch of it:

- Create the fork on GitHub, using the fork button.
- `cd` to the original clone of the repo on your machine
- `git remote rename origin upstream`
- `git remote add origin [email protected]:<location of fork>`

Now `origin` refers to your fork and `upstream` refers to the original version.
Now `git push -u origin main` to update the fork, and make pull requests
against the original repo.

To pull in updates from the origin repo, run `git fetch upstream` followed by
`git rebase upstream/main` (or whatever branch you're working in).

## Pull Requests

If you have write access to the repo, you can directly branch off of `main`.
This makes it easier for project maintainers to directly make changes to your
branch should the need arise.

Branch names should be prefixed with the author's GitHub username followed by
an associated issue number and short description of the feature, eg.
`username/12-feature-x`.

Pull requests are made against `main` and are squash-merged into main.

PRs must:

- make reference to an issue outlining the context (e.g. `Resolves: #12`)
- update any relevant documentation and include tests

Pull requests should aim to be small and self-contained to facilitate quick
review and merging. Larger change sets should be broken up across multiple PRs.
Commits should be concise but informative, and moderately clean. Commits will be
squashed into a single commit for the PR with all the commit messages.
Loading

0 comments on commit be68105

Please sign in to comment.