-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(astroport): add customized factory and PCL contracts (#1)
- Loading branch information
Showing
45 changed files
with
11,354 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,120 @@ | ||
name: Compiled binaries checks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_NET_GIT_FETCH_WITH_CLI: true | ||
|
||
jobs: | ||
fetch_deps: | ||
name: Fetch cargo dependencies | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v3 | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: | | ||
${{ secrets.GOV_PRIVATE_KEY }} | ||
${{ secrets.CORE_PRIVATE_KEY }} | ||
- uses: actions/cache@v3 | ||
if: always() | ||
with: | ||
path: | | ||
~/.cargo/bin | ||
~/.cargo/git/checkouts | ||
~/.cargo/git/db | ||
~/.cargo/registry/cache | ||
~/.cargo/registry/index | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo- | ||
- run: | | ||
git config url."ssh://[email protected]/astroport-fi/hidden_astroport_governance.git".insteadOf "https://github.com/astroport-fi/hidden_astroport_governance" | ||
git config url."ssh://[email protected]/astroport-fi/hidden_astroport_core.git".insteadOf "https://github.com/astroport-fi/hidden_astroport_core" | ||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: 1.68.0 | ||
override: true | ||
|
||
- name: Fetch cargo deps | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fetch | ||
args: --locked | ||
|
||
check-artifacts-size: | ||
runs-on: ubuntu-latest | ||
name: Check Artifacts Size | ||
needs: fetch_deps | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin | ||
~/.cargo/git/checkouts | ||
~/.cargo/git/db | ||
~/.cargo/registry/cache | ||
~/.cargo/registry/index | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
# docker can't pull private sources, so we fail if cache is missing | ||
fail-on-cache-miss: true | ||
|
||
- name: Build Artifacts | ||
run: | | ||
docker run \ | ||
-v "$GITHUB_WORKSPACE":/code \ | ||
-v ~/.cargo/registry:/usr/local/cargo/registry \ | ||
-v ~/.cargo/git:/usr/local/cargo/git \ | ||
cosmwasm/workspace-optimizer:0.12.13 | ||
- name: Save artifacts cache | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: artifacts | ||
key: ${{ runner.os }}-artifacts-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Check Artifacts Size | ||
run: | | ||
$GITHUB_WORKSPACE/scripts/check_artifacts_size.sh | ||
cosmwasm-check: | ||
runs-on: ubuntu-latest | ||
name: Cosmwasm check | ||
needs: check-artifacts-size | ||
steps: | ||
# We need this only to get Cargo.lock | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
- name: Restore cached artifacts | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: artifacts | ||
key: ${{ runner.os }}-artifacts-${{ hashFiles('**/Cargo.lock') }} | ||
fail-on-cache-miss: true | ||
- name: Install cosmwasm-check | ||
# Uses --debug for compilation speed | ||
run: cargo install --debug --version 1.4.0 cosmwasm-check | ||
- name: Cosmwasm check | ||
run: | | ||
cosmwasm-check $GITHUB_WORKSPACE/artifacts/*.wasm --available-capabilities cosmwasm_1_1,iterator,stargate |
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,62 @@ | ||
name: Code coverage | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_NET_GIT_FETCH_WITH_CLI: true | ||
|
||
jobs: | ||
code-coverage: | ||
name: Code coverage | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: | | ||
${{ secrets.GOV_PRIVATE_KEY }} | ||
${{ secrets.CORE_PRIVATE_KEY }} | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- run: | | ||
git config url."ssh://[email protected]/astroport-fi/hidden_astroport_governance.git".insteadOf "https://github.com/astroport-fi/hidden_astroport_governance" | ||
git config url."ssh://[email protected]/astroport-fi/hidden_astroport_core.git".insteadOf "https://github.com/astroport-fi/hidden_astroport_core" | ||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: 1.68.0 | ||
override: true | ||
|
||
- name: Run cargo-tarpaulin | ||
uses: actions-rs/[email protected] | ||
with: | ||
version: '0.22.0' | ||
args: '--exclude-files *tests*.rs target*.rs -e astroport-osmo-e2e-tests --workspace -o Html' | ||
|
||
- name: Attach coverage report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: ${{ github.workspace }}/tarpaulin-report.html | ||
if-no-files-found: error | ||
|
||
- name: Upload to codecov.io | ||
if: github.ref == 'refs/heads/main' | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
fail_ci_if_error: 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,37 @@ | ||
name: Release Artifacts | ||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
release-artifacts: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin | ||
~/.cargo/git/checkouts | ||
~/.cargo/git/db | ||
~/.cargo/registry/cache | ||
~/.cargo/registry/index | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
# docker can't pull private sources, so we fail if cache is missing | ||
fail-on-cache-miss: true | ||
- name: Build Artifacts | ||
run: | | ||
docker run \ | ||
-v "$GITHUB_WORKSPACE":/code \ | ||
-v ~/.cargo/registry:/usr/local/cargo/registry \ | ||
-v ~/.cargo/git:/usr/local/cargo/git \ | ||
cosmwasm/workspace-optimizer:0.12.13 | ||
tar -zcvf cosmwasm-artifacts.tar.gz artifacts | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: cosmwasm-artifacts.tar.gz | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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,76 @@ | ||
name: Contract tests and checks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_NET_GIT_FETCH_WITH_CLI: true | ||
|
||
jobs: | ||
test_and_check: | ||
name: Test and check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v3 | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: | | ||
${{ secrets.GOV_PRIVATE_KEY }} | ||
${{ secrets.CORE_PRIVATE_KEY }} | ||
- uses: actions/cache@v3 | ||
if: always() | ||
with: | ||
path: | | ||
~/.cargo/bin | ||
~/.cargo/git/checkouts | ||
~/.cargo/git/db | ||
~/.cargo/registry/cache | ||
~/.cargo/registry/index | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo- | ||
- run: | | ||
git config url."ssh://[email protected]/astroport-fi/hidden_astroport_governance.git".insteadOf "https://github.com/astroport-fi/hidden_astroport_governance" | ||
git config url."ssh://[email protected]/astroport-fi/hidden_astroport_core.git".insteadOf "https://github.com/astroport-fi/hidden_astroport_core" | ||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: 1.68.0 | ||
override: true | ||
target: wasm32-unknown-unknown | ||
components: rustfmt, clippy, llvm-tools-preview | ||
|
||
- name: Run tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --no-fail-fast --locked -- --test-threads 1 # disable parallelism due to issue with test-tube that cause flaky tests | ||
env: | ||
RUST_BACKTRACE: 1 | ||
|
||
- name: Run cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: -- -D warnings | ||
|
||
- name: Run cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check |
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,2 @@ | ||
/target | ||
/artifacts/ |
Oops, something went wrong.