Skip to content

Commit d5f7be6

Browse files
authored
Merge pull request #13 from public-awesome/tasiov/royalty-registry
Royalty Registry Contract
2 parents 7ddf54d + 4105d89 commit d5f7be6

File tree

93 files changed

+15145
-2320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+15145
-2320
lines changed

.cargo/config

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[alias]
2-
wasm = "build --lib --release --target wasm32-unknown-unknown"
3-
wasm-debug = "build --target wasm32-unknown-unknown"
2+
wasm = "build --lib --release --target wasm32-unknown-unknown --workspace --exclude sg-multi-test"
3+
wasm-debug = "build --lib --target wasm32-unknown-unknown --workspace --exclude sg-multi-test"
44
unit-test = "test --lib -- --nocapture"
5-
lint = "clippy -- -D warnings"
6-
e2e-test = "test --package e2e-tests -- --nocapture --ignored --test-threads 1 -Z unstable-options --report-time"
5+
lint = "clippy -- -D warnings"

.codecov.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ coverage:
1212
default:
1313
enabled: no
1414
ignore:
15-
- "contracts/loyalty/.*"
16-
- "test/.*"
15+
- "packages/sg-std/.*"
16+
- "packages/sg-multi-test/.*"
17+
- "unit-tests"

.github/workflows/basic.yml

+28-38
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml
2-
3-
on: [pull_request]
4-
51
name: Basic
62

3+
on:
4+
pull_request:
5+
76
jobs:
87
compile:
98
name: Compile
@@ -25,28 +24,6 @@ jobs:
2524
with:
2625
command: wasm
2726
args: --locked
28-
env:
29-
RUSTFLAGS: "-C link-arg=-s"
30-
31-
coverage:
32-
name: Coverage
33-
runs-on: ubuntu-latest
34-
container:
35-
image: xd009642/tarpaulin:0.24.0
36-
options: --security-opt seccomp=unconfined
37-
steps:
38-
- name: Checkout repository
39-
uses: actions/checkout@v2
40-
41-
- name: Generate code coverage
42-
run: |
43-
cargo tarpaulin --verbose --workspace --timeout 120 --out Xml
44-
45-
- name: Upload to codecov.io
46-
uses: codecov/codecov-action@v2
47-
with:
48-
token: ${{secrets.CODECOV_TOKEN}}
49-
fail_ci_if_error: true
5027

5128
lint:
5229
name: Lint
@@ -63,26 +40,19 @@ jobs:
6340
override: true
6441
components: rustfmt, clippy
6542

43+
- uses: extractions/setup-just@v1
44+
6645
- name: Run cargo doc
6746
uses: actions-rs/cargo@v1
6847
with:
6948
command: doc
70-
args: -F library
71-
72-
- name: Run cargo fmt
73-
uses: actions-rs/cargo@v1
74-
with:
75-
command: fmt
76-
args: --all -- --check
49+
args: -F library --no-deps
7750

7851
- name: Run cargo clippy
79-
uses: actions-rs/cargo@v1
80-
with:
81-
command: clippy
82-
args: -- -D warnings
52+
run: just lint
8353

8454
- name: Generate Schema
85-
run: sh scripts/schema.sh
55+
run: just schema
8656

8757
- name: Schema Changes
8858
# fails if any changes not committed
@@ -93,3 +63,23 @@ jobs:
9363
git status && git --no-pager diff
9464
exit 1
9565
fi
66+
67+
coverage:
68+
name: Coverage
69+
runs-on: ubuntu-latest
70+
container:
71+
image: xd009642/tarpaulin:0.24.0
72+
options: --security-opt seccomp=unconfined
73+
steps:
74+
- name: Checkout repository
75+
uses: actions/checkout@v2
76+
77+
- name: Generate code coverage
78+
run: |
79+
cargo tarpaulin --verbose --workspace --timeout 120 --out Xml
80+
81+
- name: Upload to codecov.io
82+
uses: codecov/codecov-action@v2
83+
with:
84+
token: ${{secrets.CODECOV_TOKEN}}
85+
fail_ci_if_error: true

.github/workflows/e2e.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: E2E Integration Tests
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
test:
8+
name: E2E tests
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout sources
12+
uses: actions/checkout@v3
13+
14+
- name: Install latest nightly toolchain
15+
uses: dtolnay/rust-toolchain@stable
16+
with:
17+
toolchain: nightly
18+
targets: wasm32-unknown-unknown
19+
20+
- name: Rust Dependencies Cache
21+
uses: actions/cache@v3
22+
with:
23+
path: |
24+
~/.cargo/registry/index/
25+
~/.cargo/registry/cache/
26+
~/.cargo/git/db/
27+
target/
28+
artifacts/
29+
key: ${{ runner.os }}-cargo-with-artifacts-${{ hashFiles('**/Cargo.lock') }}
30+
31+
- uses: extractions/setup-just@v1
32+
33+
- name: Download artifacts
34+
run: just download-artifacts
35+
36+
- name: Optimize contracts
37+
run: just optimize
38+
39+
- name: Run local stargaze chain
40+
run: just deploy-local
41+
42+
- name: Run e2e tests
43+
run: just e2e-test

.github/workflows/release.yml

+20-27
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,29 @@
1-
name: Release Wasm
1+
name: Build and Upload Contracts
22

33
on:
44
release:
5-
types: [created]
5+
types: [created, edited]
66

77
jobs:
8-
release:
9-
name: Release
8+
build_and_upload_contracts:
109
runs-on: ubuntu-latest
10+
1111
steps:
12-
- name: Checkout sources
12+
- uses: extractions/setup-just@v1
13+
14+
- name: Checkout code
1315
uses: actions/checkout@v2
14-
- name: Install cargo-run-script
15-
uses: actions-rs/cargo@v1
16-
with:
17-
command: install
18-
args: cargo-run-script
19-
- name: Run cargo optimize
20-
uses: actions-rs/cargo@v1
21-
with:
22-
command: run-script
23-
args: optimize
24-
- name: Get release ID
25-
id: get_release
26-
uses: bruceadams/[email protected]
27-
env:
28-
GITHUB_TOKEN: ${{ github.token }}
29-
- name: Upload optimized wasm
30-
uses: svenstaro/upload-release-action@v2
16+
17+
- name: Build development contracts
18+
run: just optimize
19+
20+
- name: Show data
21+
run: |
22+
ls -l artifacts
23+
cat artifacts/checksums.txt
24+
25+
- name: Publish artifacts on GitHub
26+
uses: softprops/action-gh-release@v1
3127
with:
32-
repo_token: ${{ secrets.GITHUB_TOKEN }}
33-
file: ./artifacts/*.wasm
34-
tag: ${{ github.ref }}
35-
overwrite: true
36-
file_glob: true
28+
files: |
29+
artifacts/*

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,16 @@
1818
# IDEs
1919
*.iml
2020
.idea
21+
22+
# Typescript
23+
*-debug.log
24+
*-error.log
25+
/.nyc_output
26+
/package-lock.json
27+
lib
28+
dist
29+
tmp
30+
node_modules
31+
oclif.manifest.json
32+
lerna-debug.log
33+
tsconfig.tsbuildinfo

0 commit comments

Comments
 (0)