-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from AbstractSDK/buckram/cargo-generatable
cargo generate
- Loading branch information
Showing
84 changed files
with
561 additions
and
4,004 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,2 @@ | ||
meta/ | ||
build/ |
File renamed without changes.
File renamed without changes.
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,48 @@ | ||
permissions: | ||
contents: read | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
schedule: | ||
- cron: "7 7 * * *" | ||
name: rolling | ||
jobs: | ||
# https://twitter.com/mycoliza/status/1571295690063753218 | ||
nightly: | ||
runs-on: ubuntu-latest | ||
name: ubuntu / nightly | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Install nightly | ||
uses: dtolnay/rust-toolchain@nightly | ||
- name: cargo generate-lockfile | ||
if: hashFiles('Cargo.lock') == '' | ||
run: cargo generate-lockfile | ||
- name: cargo test --locked | ||
run: cargo test --locked --all-features --all-targets | ||
# https://twitter.com/alcuadrado/status/1571291687837732873 | ||
update: | ||
runs-on: ubuntu-latest | ||
name: ubuntu / beta / updated | ||
# There's no point running this if no Cargo.lock was checked in in the | ||
# first place, since we'd just redo what happened in the regular test job. | ||
# Unfortunately, hashFiles only works in if on steps, so we reepeat it. | ||
# if: hashFiles('Cargo.lock') != '' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Install beta | ||
if: hashFiles('Cargo.lock') != '' | ||
uses: dtolnay/rust-toolchain@beta | ||
- name: cargo update | ||
if: hashFiles('Cargo.lock') != '' | ||
run: cargo update | ||
- name: cargo test | ||
if: hashFiles('Cargo.lock') != '' | ||
run: cargo test --locked --all-features --all-targets | ||
env: | ||
RUSTFLAGS: -D deprecated |
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,27 @@ | ||
permissions: | ||
contents: read | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
name: test | ||
jobs: | ||
required: | ||
runs-on: ubuntu-latest | ||
name: ubuntu / ${{ matrix.toolchain }} | ||
strategy: | ||
matrix: | ||
toolchain: [stable, beta] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Install ${{ matrix.toolchain }} | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
- name: cargo generate-lockfile | ||
if: hashFiles('Cargo.lock') == '' | ||
run: cargo generate-lockfile | ||
- name: cargo test --locked | ||
run: cargo test --locked --all-features --all-targets |
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,25 @@ | ||
permissions: | ||
contents: read | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
name: check | ||
jobs: | ||
clippy: | ||
runs-on: ubuntu-latest | ||
name: stable / clippy | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Install stable | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy | ||
- name: install cargo-generate | ||
run: cargo install cargo-generate --locked | ||
- name: cargo clippy | ||
run: | | ||
CARGO_GENERATE_TEST_CMD="cargo clippy --all-features -- -D warnings" \ | ||
cargo generate -d include_app=true -d include_adapter=true -d app_name=my_app -d adapter_name=my_adapter --test |
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 |
---|---|---|
|
@@ -14,3 +14,6 @@ state.json | |
typescript/node_modules | ||
|
||
contracts/**/schema | ||
schema/ | ||
|
||
build/ |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[template] | ||
ignore = [".github", "artifacts", "target"] | ||
|
||
[hooks] | ||
post = ["post-script.rhai"] | ||
|
||
[placeholders] | ||
include_app = { prompt = "Include App Module", default = true, type = "bool" } | ||
include_adapter = { prompt = "Include Adapter Module", default = true, type = "bool" } | ||
|
||
[conditional.'include_app'.placeholders] | ||
app_name = { prompt = "Enter App Name", default = "my_app", type = "string" } | ||
|
||
[conditional.'include_adapter'.placeholders] | ||
adapter_name = { prompt = "Enter Adapter Name", default = "my_adapter", type = "string" } | ||
|
||
# Ignore files if not included | ||
[conditional.'!include_app'] | ||
ignore = ["contracts/{{app_name}}"] | ||
[conditional.'!include_adapter'] | ||
ignore = ["contracts/{{adapter_name}}"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.