Skip to content

Commit

Permalink
Merge with osmosis-labs/cw-tokenfactory-issuer, commit history preserved
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeHartnell committed Aug 20, 2023
2 parents 62f76dc + b6d0acc commit 388681a
Show file tree
Hide file tree
Showing 477 changed files with 122,881 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ all-test = "test --workspace"
schema = "run --bin schema"

[env]
RUSTFLAGS = "-C link-arg=-s"
RUSTFLAGS = "-C link-arg=-s"
12 changes: 12 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Cargo audit
on:
schedule:
- cron: '0 0 * * *'
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
78 changes: 78 additions & 0 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# 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 latest stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
override: true

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

- name: Compile WASM contract
uses: actions-rs/cargo@v1
with:
toolchain: stable
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:
toolchain: stable
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: clippy
args: --all-targets -- -D warnings

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

- name: Show Schema changes
run: git status --porcelain

- name: Schema Changes
# fails if any changes not committed
run: test -z "$(git status --porcelain)"
20 changes: 20 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: coverage
"on":
- push
jobs:
test:
name: coverage
runs-on: ubuntu-latest
container:
image: "xd009642/tarpaulin:develop-nightly"
options: "--security-opt seccomp=unconfined"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Generate code coverage
run: >
cargo tarpaulin --verbose --workspace --out Xml --exclude-files test-contracts/* *test*.rs packages/dao-dao-macros/* packages/dao-testing/* ci/*
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
101 changes: 101 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Integration Tests

on:
pull_request:
push:
branches:
- main

jobs:
test:
name: Integration tests
runs-on: ubuntu-latest
env:
GAS_OUT_DIR: gas_reports
GAS_LIMIT: 100000000
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install latest nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2023-02-02
target: wasm32-unknown-unknown
override: true

- 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') }}

- name: Set latest just version
run: echo "JUST_VERSION=$(cargo search just -q | sed -n -e '/^just[[:space:]]/p' | cut -d '"' -f 2)" >> $GITHUB_ENV

- name: Get cached just
uses: actions/cache@v3
with:
path: ~/.cargo/bin/just
key: ${{ runner.os }}-just-${{ env.JUST_VERSION }}

- name: Install just
run: cargo install just || true

- name: Get mainnet GAS_LIMIT
run: echo "MAINNET_GAS_LIMIT=$(curl -s https://juno-rpc.polkachu.com/consensus_params | jq -r '.result.consensus_params.block.max_gas')" >> $GITHUB_ENV

- name: Mainnet block GAS_LIMIT changed
if: ${{ env.MAINNET_GAS_LIMIT != env.GAS_LIMIT }}
uses: actions/github-script@v6
with:
script: core.setFailed(`Integration tests must update GAS_LIMIT from ${process.env.GAS_LIMIT} to ${process.env.MAINNET_GAS_LIMIT}`)

- name: Run Integration Tests
run: just integration-test

- name: Combine Test Gas Reports
run: cd ci/integration-tests/ && jq -rs 'reduce .[] as $item ({}; . * $item)' gas_reports/*.json > gas_report.json

- name: Raw Gas Report
run: cat ci/integration-tests/gas_report.json

- name: Set GIT_BRANCH
run: echo "GIT_BRANCH=$(echo ${{ github.ref }} | sed 's|/|-|g')" >> $GITHUB_ENV

- name: Upload Gas Report
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v3
with:
name: dao-dao-gas-report-${{ env.GIT_BRANCH }}
path: ci/integration-tests/gas_report.json
retention-days: 90

- name: Download main gas report
id: download_gas
# Because the max retention period of github artifacts is 90 days
# there's a possibility the main's report no longer exists
continue-on-error: true
if: ${{ github.ref != 'refs/heads/main' }}
# NOTE: We can't use github's `actions/download-artifact` because it doesnt support
# downloading an artifact cross workflows yet
# https://github.com/actions/download-artifact/issues/3
uses: dawidd6/action-download-artifact@v2
with:
branch: main
workflow: integration_tests.yml
name: dao-dao-gas-report-refs-heads-main

- name: Post gas diff to PR
if: ${{ github.ref != 'refs/heads/main' && steps.download_gas.outputs.found_artifact == 'true' }}
uses: de-husk/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
current_json: ci/integration-tests/gas_report.json
old_json: gas_report.json
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# macOS
.DS_Store

# Text file backups
**/*.rs.bk

# Build results
target/

# IDEs
.vscode/
.idea/
*.iml
**/.editorconfig

# Auto-gen
.cargo-ok

# Build artifacts
*.wasm
hash.txt
contracts.txt
artifacts/

# code coverage
tarpaulin-report.*

# integration tests
gas_reports/
ci/configs/cosm-orc/local.yaml

contracts/**/Cargo.lock
packages/**/Cargo.lock
debug/**/Cargo.lock
ci/**/Cargo.lock
23 changes: 23 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Code of conduct

Be kind to one another.

> Good walkers leave no track.
> Good counters don’t use their fingers.
> The best door’s unlocked and unopened.
> The best knot’s not in a rope and can’t be untied.
>
> So wise souls are good at caring for people,
> never turning their back on anyone.
> They’re good at looking after things,
> never turning their back on anything.
> There’s a light hidden here.
>
> Good people teach people who aren’t good yet;
> the less good are the makings of the good.
> Anyone who doesn’t respect a teacher
> or cherish a student
> may be clever, but has gone astray.
> There’s a deep mystery here.
- [Tao Te Ching (Ursula Le Guin transaltion)](https://github.com/lovingawareness/tao-te-ching/blob/master/Ursula%20K%20Le%20Guin.md)
Loading

0 comments on commit 388681a

Please sign in to comment.