-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into HEAD
- Loading branch information
Showing
266 changed files
with
13,871 additions
and
3,918 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
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
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 |
---|---|---|
@@ -1,18 +1,22 @@ | ||
# Verify that generated code is up-to-date. | ||
# | ||
# Note that we run these checks regardless whether the input files have | ||
# changed, because generated code can change in response to toolchain updates | ||
# even if no files in the repository are modified. | ||
name: Check generated code | ||
# Ensure that generated code is up-to-date. | ||
name: Generate protobuf code | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- '*' | ||
paths: | ||
- 'proto/**' | ||
- '**/**.proto' | ||
- '**/**.pb.go' | ||
- '**/**.sum' | ||
- '**/client/**.go' | ||
- 'scripts/ci/**' | ||
- 'Makefile' | ||
- 'Dockerfile' | ||
- '.github/workflows/check-generated.yml' | ||
|
||
permissions: | ||
contents: read | ||
contents: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
|
@@ -22,15 +26,21 @@ jobs: | |
check-proto: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: 🐿 Setup Golang | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '^1.20' | ||
- | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 # we need a .git directory to run git diff | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- | ||
name: "Check protobuf generated code" | ||
run: scripts/ci/check-generated.sh | ||
run: | | ||
make proto-all | ||
make run-querygen | ||
- | ||
name: Commit changes | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add *.go | ||
git add *.proto | ||
git commit -m "Generated protofile changes" || echo "No changes to commit" | ||
git push |
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 |
---|---|---|
|
@@ -4,10 +4,26 @@ on: | |
pull_request: | ||
branches: | ||
- "**" | ||
paths: | ||
- "**/**/*.wasm" | ||
- "**/**.rs" | ||
- "**/**Cargo.toml" | ||
- "**/**Cargo.lock" | ||
- "**/cosmwasm/**" | ||
- "**/wasmbinding/**" | ||
- ".github/workflows/contracts.yml" | ||
push: | ||
branches: | ||
- "main" | ||
- "v[0-9]**" | ||
paths: | ||
- "**/**/*.wasm" | ||
- "**/**.rs" | ||
- "**/**Cargo.toml" | ||
- "**/**Cargo.lock" | ||
- "**/cosmwasm/**" | ||
- "**/wasmbinding/**" | ||
- ".github/workflows/contracts.yml" | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
|
@@ -30,13 +46,6 @@ jobs: | |
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
- uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
**/**/*.wasm | ||
**/**.rs | ||
**/**Cargo.toml | ||
**/**Cargo.lock | ||
|
||
- name: Optimize | ||
working-directory: ${{ matrix.contract.workdir }} | ||
|
@@ -46,29 +55,25 @@ jobs: | |
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ | ||
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ | ||
cosmwasm/workspace-optimizer:0.12.10 | ||
if: env.GIT_DIFF | ||
- name: 'Upload optimized contract artifact' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.contract.name }} | ||
path: ${{ matrix.contract.workdir }}${{ matrix.contract.build }} | ||
retention-days: 1 | ||
if: env.GIT_DIFF | ||
|
||
- name: 'Upload Cargo.lock artifact' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Cargo.lock | ||
path: ${{ matrix.contract.workdir }}Cargo.lock | ||
retention-days: 1 | ||
if: env.GIT_DIFF | ||
|
||
# TODO: workspace optimizer compiles all contracts in the workspace, so we could just run that once | ||
# and then check the diff of all the bytecode files | ||
- name: Check Test Data | ||
working-directory: ${{ matrix.contract.workdir }} | ||
if: env.GIT_DIFF | ||
run: > | ||
diff "${GITHUB_WORKSPACE}/${{ matrix.contract.bytecode }}" ${{ matrix.contract.build }} | ||
|
@@ -87,31 +92,20 @@ jobs: | |
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
- uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
**/bytecode/*.wasm | ||
**/**.rs | ||
**/**Cargo.toml | ||
**/**Cargo.lock | ||
- name: Install toolchain | ||
uses: dtolnay/[email protected] | ||
with: | ||
target: wasm32-unknown-unknown | ||
if: env.GIT_DIFF | ||
|
||
- name: Add the wasm target | ||
working-directory: ${{ matrix.contract.workdir }} | ||
run: > | ||
rustup target add wasm32-unknown-unknown; | ||
if: env.GIT_DIFF | ||
- name: Test | ||
working-directory: ${{ matrix.contract.workdir }} | ||
run: > | ||
cargo test | ||
if: env.GIT_DIFF | ||
|
||
lints: | ||
name: Cosmwasm Lints | ||
|
@@ -123,27 +117,18 @@ jobs: | |
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
- uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
**/**.rs | ||
**/**Cargo.toml | ||
**/**Cargo.lock | ||
- name: Install toolchain | ||
uses: dtolnay/[email protected] | ||
with: | ||
components: rustfmt, clippy | ||
if: env.GIT_DIFF | ||
|
||
- name: Format | ||
working-directory: ${{ matrix.workdir }} | ||
run: > | ||
cargo fmt --all -- --check | ||
if: env.GIT_DIFF | ||
- name: run cargo clippy | ||
working-directory: ${{ matrix.workdir }} | ||
run: > | ||
cargo clippy -- -D warnings | ||
if: env.GIT_DIFF | ||
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,52 @@ | ||
name: Render and Deploy Docs | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
|
||
build: | ||
name: Render and deploy protocol and API docs | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the source code | ||
uses: actions/checkout@v3 | ||
with: | ||
lfs: true | ||
- name: Install rust toolchain | ||
uses: dtolnay/rust-toolchain@nightly | ||
- name: Load Rust caching | ||
uses: astriaorg/[email protected] | ||
- name: Load get-version action to grab version component of deployment path | ||
uses: battila7/get-version-action@v2 | ||
id: get_version | ||
- name: Print version component of deployment path | ||
run: echo ${{ steps.get_version.outputs.version }} | ||
- name: Install mdbook | ||
run: cargo install mdbook mdbook-katex mdbook-mermaid | ||
- name: Build protocol spec | ||
run: cd docs/protocol && mdbook build | ||
- name: Move protocol spec to subdirectory & Deploy | ||
env: | ||
DO_DOCS_PK: ${{ secrets.DO_DOCS_PK }} | ||
DO_DOCS_IP: ${{ secrets.DO_DOCS_IP }} | ||
run: | | ||
cd docs/protocol | ||
if [ -d "do-tmp" ]; then rm -rf do-tmp; fi | ||
mkdir do-tmp | ||
mv book do-tmp/${{ steps.get_version.outputs.version }} | ||
tree do-tmp | ||
which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y ) | ||
which rsync || ( apt-get update -y && apt-get install rsync -y ) | ||
eval $(ssh-agent -s) | ||
ssh-add <(echo "$DO_DOCS_PK" ) | ||
mkdir -p ~/.ssh | ||
chmod 700 ~/.ssh | ||
ssh-keyscan $DO_DOCS_IP >> ~/.ssh/known_hosts | ||
chmod 644 ~/.ssh/known_hosts | ||
cd do-tmp/main | ||
scp -r * root@$DO_DOCS_IP:/var/www/html |
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
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
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 |
---|---|---|
|
@@ -43,6 +43,7 @@ linters: | |
- unconvert | ||
- unused | ||
- whitespace | ||
- unparam | ||
|
||
issues: | ||
exclude-rules: | ||
|
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
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
Oops, something went wrong.