Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Royalty Registry Contract #13

Merged
merged 18 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[alias]
wasm = "build --lib --release --target wasm32-unknown-unknown"
wasm-debug = "build --target wasm32-unknown-unknown"
wasm = "build --lib --release --target wasm32-unknown-unknown --workspace --exclude sg-multi-test"
wasm-debug = "build --lib --target wasm32-unknown-unknown --workspace --exclude sg-multi-test"
unit-test = "test --lib -- --nocapture"
lint = "clippy -- -D warnings"
e2e-test = "test --package e2e-tests -- --nocapture --ignored --test-threads 1 -Z unstable-options --report-time"
lint = "clippy -- -D warnings"
5 changes: 3 additions & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ coverage:
default:
enabled: no
ignore:
- "contracts/loyalty/.*"
- "test/.*"
- "packages/sg-std/.*"
- "packages/sg-multi-test/.*"
- "unit-tests"
66 changes: 28 additions & 38 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml

on: [pull_request]

name: Basic

on:
pull_request:

jobs:
compile:
name: Compile
Expand All @@ -25,28 +24,6 @@ jobs:
with:
command: wasm
args: --locked
env:
RUSTFLAGS: "-C link-arg=-s"

coverage:
name: Coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:0.24.0
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Generate code coverage
run: |
cargo tarpaulin --verbose --workspace --timeout 120 --out Xml

- name: Upload to codecov.io
uses: codecov/codecov-action@v2
with:
token: ${{secrets.CODECOV_TOKEN}}
fail_ci_if_error: true

lint:
name: Lint
Expand All @@ -63,26 +40,19 @@ jobs:
override: true
components: rustfmt, clippy

- uses: extractions/setup-just@v1

- name: Run cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: -F library

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

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
run: just lint

- name: Generate Schema
run: sh scripts/schema.sh
run: just schema

- name: Schema Changes
# fails if any changes not committed
Expand All @@ -93,3 +63,23 @@ jobs:
git status && git --no-pager diff
exit 1
fi

coverage:
name: Coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:0.24.0
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Generate code coverage
run: |
cargo tarpaulin --verbose --workspace --timeout 120 --out Xml

- name: Upload to codecov.io
uses: codecov/codecov-action@v2
with:
token: ${{secrets.CODECOV_TOKEN}}
fail_ci_if_error: true
43 changes: 43 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: E2E Integration Tests

on:
pull_request:

jobs:
test:
name: E2E tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install latest nightly toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
targets: wasm32-unknown-unknown

- name: Rust Dependencies Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
artifacts/
key: ${{ runner.os }}-cargo-with-artifacts-${{ hashFiles('**/Cargo.lock') }}

- uses: extractions/setup-just@v1

- name: Download artifacts
run: just download-artifacts

- name: Optimize contracts
run: just optimize

- name: Run local stargaze chain
run: just deploy-local

- name: Run e2e tests
run: just e2e-test
47 changes: 20 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
name: Release Wasm
name: Build and Upload Contracts

on:
release:
types: [created]
types: [created, edited]

jobs:
release:
name: Release
build_and_upload_contracts:
runs-on: ubuntu-latest

steps:
- name: Checkout sources
- uses: extractions/setup-just@v1

- name: Checkout code
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/get-release@v1.2.3
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload optimized wasm
uses: svenstaro/upload-release-action@v2

- name: Build development contracts
run: just optimize

- name: Show data
run: |
ls -l artifacts
cat artifacts/checksums.txt

- name: Publish artifacts on GitHub
uses: softprops/action-gh-release@v1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./artifacts/*.wasm
tag: ${{ github.ref }}
overwrite: true
file_glob: true
files: |
artifacts/*
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,16 @@
# IDEs
*.iml
.idea

# Typescript
*-debug.log
*-error.log
/.nyc_output
/package-lock.json
lib
dist
tmp
node_modules
oclif.manifest.json
lerna-debug.log
tsconfig.tsbuildinfo
Loading
Loading