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
name: Try to expand local template using cargo-generate | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
PROJECT_NAME: project-foo | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Generate project | |
uses: cargo-generate/cargo-generate-action@latest | |
with: | |
name: ${{ env.PROJECT_NAME }} | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: 1.75.0 | |
targets: wasm32-unknown-unknown | |
components: rustfmt, clippy | |
# we need to move the generated project to a temp folder, away from the template project | |
# otherwise `cargo` runs would fail | |
# see https://github.com/rust-lang/cargo/issues/9922 | |
- name: Move generated project to temp folder | |
run: mv $PROJECT_NAME ${{ runner.temp }}/ | |
- name: Test project | |
working-directory: ${{ runner.temp }}/${{ env.PROJECT_NAME }} | |
run: cargo test | |
- name: Clippy project | |
working-directory: ${{ runner.temp }}/${{ env.PROJECT_NAME }} | |
run: cargo clippy --all-targets -- -D warnings | |
- name: Fmt check project | |
working-directory: ${{ runner.temp }}/${{ env.PROJECT_NAME }} | |
run: cargo fmt --check | |
- name: Build WASM binary | |
working-directory: ${{ runner.temp }}/${{ env.PROJECT_NAME }} | |
run: cargo wasm | |
- name: Install cosmwasm-check | |
working-directory: ${{ runner.temp }}/${{ env.PROJECT_NAME }} | |
run: cargo install cosmwasm-check | |
- name: Check contracts | |
working-directory: ${{ runner.temp }}/${{ env.PROJECT_NAME }} | |
run: cosmwasm-check target/wasm32-unknown-unknown/release/*.wasm |