-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the initial commit with a new template for the cw1155 smart contract.
- Loading branch information
0 parents
commit a0ae2ea
Showing
24 changed files
with
2,011 additions
and
0 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,4 @@ | ||
[alias] | ||
wasm = "build --release --lib --target wasm32-unknown-unknown" | ||
unit-test = "test --lib" | ||
schema = "run --bin schema" |
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,61 @@ | ||
version: 2.1 | ||
|
||
executors: | ||
builder: | ||
docker: | ||
- image: buildpack-deps:trusty | ||
|
||
jobs: | ||
docker-image: | ||
executor: builder | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
- run: | ||
name: Build Docker artifact | ||
command: docker build --pull -t "cosmwasm/cw-gitpod-base:${CIRCLE_SHA1}" . | ||
- run: | ||
name: Push application Docker image to docker hub | ||
command: | | ||
if [ "${CIRCLE_BRANCH}" = "master" ]; then | ||
docker tag "cosmwasm/cw-gitpod-base:${CIRCLE_SHA1}" cosmwasm/cw-gitpod-base:latest | ||
docker login --password-stdin -u "$DOCKER_USER" \<<<"$DOCKER_PASS" | ||
docker push cosmwasm/cw-gitpod-base:latest | ||
docker logout | ||
fi | ||
docker-tagged: | ||
executor: builder | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
- run: | ||
name: Push application Docker image to docker hub | ||
command: | | ||
docker tag "cosmwasm/cw-gitpod-base:${CIRCLE_SHA1}" "cosmwasm/cw-gitpod-base:${CIRCLE_TAG}" | ||
docker login --password-stdin -u "$DOCKER_USER" \<<<"$DOCKER_PASS" | ||
docker push | ||
docker logout | ||
workflows: | ||
version: 2 | ||
test-suite: | ||
jobs: | ||
# this is now a slow process... let's only run on master | ||
- docker-image: | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- docker-tagged: | ||
filters: | ||
tags: | ||
only: | ||
- /^v.*/ | ||
branches: | ||
ignore: | ||
- /.*/ | ||
requires: | ||
- docker-image |
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,11 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.rs] | ||
indent_size = 4 |
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,75 @@ | ||
# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml | ||
|
||
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: 1.60.0 | ||
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: 1.60.0 | ||
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 | ||
|
||
- name: Generate Schema | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: schema | ||
args: --locked | ||
|
||
- name: Schema Changes | ||
# fails if any changes not committed | ||
run: git diff --exit-code schema |
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,35 @@ | ||
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: 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 |
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,16 @@ | ||
# Build results | ||
/target | ||
/schema | ||
|
||
# Cargo+Git helper file (https://github.com/rust-lang/cargo/blob/0.44.1/src/cargo/sources/git/utils.rs#L320-L327) | ||
.cargo-ok | ||
|
||
# Text file backups | ||
**/*.rs.bk | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
# IDEs | ||
*.iml | ||
.idea |
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,17 @@ | ||
### wasmd ### | ||
FROM cosmwasm/wasmd:v0.18.0 as wasmd | ||
|
||
### rust-optimizer ### | ||
FROM cosmwasm/rust-optimizer:0.11.5 as rust-optimizer | ||
|
||
FROM gitpod/workspace-full:latest | ||
|
||
COPY --from=wasmd /usr/bin/wasmd /usr/local/bin/wasmd | ||
COPY --from=wasmd /opt/* /opt/ | ||
|
||
RUN sudo apt-get update \ | ||
&& sudo apt-get install -y jq \ | ||
&& sudo rm -rf /var/lib/apt/lists/* | ||
|
||
RUN rustup update stable \ | ||
&& rustup target add wasm32-unknown-unknown |
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,10 @@ | ||
image: cosmwasm/cw-gitpod-base:v0.16 | ||
|
||
vscode: | ||
extensions: | ||
- rust-lang.rust | ||
|
||
tasks: | ||
- name: Dependencies & Build | ||
init: | | ||
cargo build |
Oops, something went wrong.