Skip to content

Commit 919ba40

Browse files
adamspofford-dfinitymraszyklwshangielashiwitter-s
authored
chore: Backport #603 to other executor v2 releases (#608)
* feat: set sender_canister_version and support canister_info (#401) * set sender_canister_version and support canister_info * use canister_info in test canister * remove Canister from CanisterChangeOrigin and CanisterChangeDetails variant types * fix: no hard-coded fees for management canister calls (#404) * btc API fees * ecdsa fees * create canister fee * mv * split http_request * http_request fee * tests * doc * bump ver & changelog * bump ver (#405) * feat: Bitcoin API handles cycles cost under the hood. (#406) * bitcoin fee * bump ver & changelog * feat: Hardcodes the fee for `sign_with_ecdsa`. (#407) * enhancements to bitcoin and ecdsa * cargo fmt * add back bitcoin prefix * bump ver and changelog * doc * fix example * fmt --------- Co-authored-by: Linwei Shang <[email protected]> * Check panic after await freeing resources (#408) * feat: Add some conversion methods to AccountIdentifier in ic-ledger-types (#352) * [enhancement] AccountIdentifier * fix: compile error * update change log * [add] unit tests --------- Co-authored-by: Linwei Shang <[email protected]> * chore: Update example http_request_required_cycles (#409) * Update example http_request_required_cycles * fmt * comment --------- Co-authored-by: Linwei Shang <[email protected]> * feat: upgrade candid to v0.9 (#411) * feat(breaking): bump CDK to use candid 0.9-beta (#367) * bump CDK to use candid 0.9-beta * make ic-ledger-types not breaking * chore: release continue (#370) * fix * bump ver * Add readme to ic-cdk-timers --------- Co-authored-by: Adam Spofford <[email protected]> * version and changelog * fix chess * disable examples using import --------- Co-authored-by: Linwei Shang <[email protected]> Co-authored-by: Adam Spofford <[email protected]> * test * add wasmtime in CI * revert * use patched ic-test-state-machine-client * feat: ic-cdk-bindgen replace import macro (#390) * import did file * fix * test * fix counter example * rename to ic-cdk-bindgen * fix profile example * no re-export * enable all example tests in CI * remove import and fix tests * fix clippy * fix ic-certified-map doc test * fmt --------- Co-authored-by: Linwei Shang <[email protected]> * feat: add export_candid macro (#386) * export candid * fix build.sh * actor macro * add wasmtime in CI * fix * fix * fix * remove actor macro * fix * ic-cdk/wasi enables export_candid * git forget declarations/ * fmt * Warning features in Cargo.toml * bump ic0 version --------- Co-authored-by: Linwei Shang <[email protected]> * prepare for release * TODO comment * changelog * doc export_candid * format changelog * bump library and changelog * explain why no doc for TransformFunc * find solution for doc TransformFunc * remove TODO * doc hidden wasi mod --------- Co-authored-by: Yan Chen <[email protected]> Co-authored-by: Adam Spofford <[email protected]> Co-authored-by: Yan Chen <[email protected]> * chore: Rust v1.65.0 and cargo workspace (#415) * rust 1.70.0 * rust update notice * link LICENSE * rust v1.65.0 * workspace.dependencies * update README and CHANGELOG (#416) * fix: only update/query macros can take guard function (#418) * fix: only update/query take guard function * trim docs * test * fix doc:wq * bump ver * changelog * fix docs * chore: update Rust toolchain (#420) * Revert MSRV (#421) * fix: export composite query correctly (#419) * fix: export composite query correctly * changelog * feat: introduce candid-extractor for candid export (#424) * remove wasi feature * export_candid * examples and CI * speed up ic-wasm install * fix * add candid-extractor crate * update readme and ic0.txt * update CI * fix CI * try again * fix ci * fix * bump versions and update changelog * update date * Update src/ic-cdk-timers/CHANGELOG.md Co-authored-by: Adam Spofford <[email protected]> --------- Co-authored-by: Adam Spofford <[email protected]> * chore: CI for release candid-extractor (#427) * include wat * binstall CI * fix url * v0.1.1 * fix CI * versioned runner * include root Cargo.lock * ubuntu 22.04 * chore: unify Rust toolchain version (#429) * override toolchain in CI * comments * execute rustup override set * remove MSRV of candid-extractor * set MSRV to 1.66.0 and use it everywhere * unify cache key hashFiles * concise Cargo.toml members * candidi-extractor MSRV * fix CI test job * clippy * comment * fix: Remove global state from `ic-cdk-macros` (#430) * Remove global state from ic-cdk-macros * Update version and changelog * Release [email protected], [email protected] (#433) * feat: cycles_burn (#434) * ic0.txt * safe api * doc * update ic-test-state-machine * test * changelog * Release [email protected] (#437) * feat: RUN-798: Add call context perf counter (#435) * feat: RUN-798: Add call context perf counter * deprecated note * improve doc * fmt * v0.11.3 and changelog --------- Co-authored-by: Linwei Shang <[email protected]> * test: refactor management_canister tests (#438) * move main/provisonal tests to e2e * refactor management example * use stable rust in examples * periodically run CI to keep cache available * fmt * single quote in yml * 0 for Sunday * chore(ci): use `dfinity/setup-dfx` GitHub Action to install `dfx` (#439) * fix (#440) * test: remove vendored actions (#441) * use original action instead of dfinity fork * regex based conventional pr title * bats submodules * use bats from submodule in examples.yml * try fix * checkout submodules only in test * test: fix print example (#443) * fix * add bats test * Adding icrc1_memo to the Transaction (#445) * feat: Added query stats to canister status endpoint (#432) * Added query stats to canister status endpoint * Changelog * pub and doc * update ic-state-machine * Adopt new API as discussed with Martin * bump ic-cdk v0.11.4 --------- Co-authored-by: Linwei Shang <[email protected]> * chore: Upgrade candid to v0.10 (#448) * chore: Upgrade candid to v0.10 This upgrades candid to the new libary version which has been split into smaller pieces, hence reducing the size of the dependencies for downstream projects. * Adapt cdk-bindgen to new candid_parser library * Remove setting default value again * Remove candid dependency from ic-cdk-bindgen * Reword changelog entry * Accommodate candid changes with regards to Nat conversions * Update remaining candid references * Update even more candid references * Fix counter example * Fix nat comparison * bump versions and changelog * cargo update * bump ic-cdk-macros * mv compile tests to ic-cdk * bump ic-cdk-bindgen * README --------- Co-authored-by: Linwei Shang <[email protected]> * feat: Add `reserved_cycles` and `reserved_cycles_limit` (#449) * feat: Add `reserved_cycles` and `reserved_cycles_limit` This adds the new fields to the API of the management canister: - `reserved_cycles` to `CanisterStatusResponse`. - `reserved_cycles_limit` to `CanisterSettings` and `DefiniteCanisterSettings`. More information: - https://forum.dfinity.org/t/23447 - https://dashboard.internetcomputer.org/proposal/126094 * Add to CHANGELOG and fix errors * changelog details --------- Co-authored-by: Linwei Shang <[email protected]> * feat: "hidden" attribute to exclude exporting method in export_candid!() (#451) * feat: no_export attribute to exclude exporting method in did file * changelog * test: example & macro compile * rename to hidden * typo --------- Co-authored-by: Linwei Shang <[email protected]> * fix: query stats: make members public (#453) * feat: Serde Serialize and Deserialize traits for the RbTree in the ic-certified-map crate. (#399) * This change adds the serde Serialize and Deserialize traits to the RbTree. * Manual implementation of Serialize and Deserialize for the RbTree. * replace 'static lifetime bounds with a custom lifetime 't. * Added bincode serialization in the serde test. * CandidType for the RbTree. * update CHANGELOG with CandidType. * docs: more informative README and call* methods (#454) * docs: ic-cdk README * docs: README for macros * docs: call* methods * chore: bump version and changelog * fix: grammar and format * fix: a leftover lock change from other PR * feat: `is_recovering_from_trap` (#456) * Raise MSRV to 1.70.0 (#457) * chore(deps): bump zerocopy from 0.7.26 to 0.7.32 (#458) * fix(bindgen): look for standardized environment variables (#467) * feat: resolve env vars * test: e2e using profile example * chore: clean up dfx.json * chore: bump ver & changelog * chore: dfx v0.13.1 * fix: profile bats * try the workaround * workaround * fmt * chore(ci): examples run with latest dfx (#468) * chore: upgrade CI dependencies & use latest in setup-dfx * chore: correct comment * fix: add mising export_candid! * feat!: config canister endpoint decoding quota (#465) * feat: config canister endpoint decoding quota * add call_with_config * fix * fix * changelog * fix * fix * update changelog * chore: release ic-cdk v0.13.0 (#469) * chore: release ic-cdk v0.13.0 * chore: ic-ledger-types v0.10.0 * chore: release ic-cdk v0.13.1 and ic-cdk-macros v0.9.0 (#470) * chore: release ic-cdk v0.13.1 and ic-cdk-macros v0.9.0 * pin ic-cdk-macros to a specific version * chore: release ic-cdk-timers v0.7.0 (#471) * chore: examples overhaul (#473) * make assertions * pin btc-canister * gitignore * comment * asset_storage * fix management * chess * counter * print * simplify profile * edition 2021 & resolver 2 * feat: provide safe wrapper of global_timer_set in ic-cdk (#475) * feat: provide safe wrapper of global_timer_set in ic-cdk * changelog * e2e test * chore(ci): remove temporary fix for bitcoin integration canister (#474) * try beta * remove with beta * remove outdated comment * feat: add management canister methods for interacting with the chunk store (#461) * feat: add management canister methods for interacting with the chunk store * Update CHANGELOG * fmt * IC spec change * Serialize with `serde_bytes` * fix: names * test: e2e chunk * chore: upgrade state-machine binary * chore: cargo fmt & clippy * fix: clippy * fix: make the tests pass * conform final spec --------- Co-authored-by: Linwei Shang <[email protected]> * chore: release ic-cdk v0.13.2 (#478) * feat: Re-generate bindings if canister id or candid path change (#479) * refactor!: move Rust code generation logic from candid_parser. (#480) * refactor!(bindgen): move Rust codegen logic from candid_parser * changelog * revert unnecessary changes * replace deprecated URLs (#481) * feat: Add `wasm_memory_limit` to the management canister (#483) * feat: Add `wasm_memory_limit` to the management canister This adds `wasm_memory_limit` to `CanisterSettings` and `DefiniteCanisterSettings`. The corresponding spec change: - dfinity/interface-spec#278 * Add the PR number to the change log * unify doc format * better test coverage --------- Co-authored-by: Linwei Shang <[email protected]> * chore: bump dependencies & improve doc tests (#484) * upgrade syn to v2 * move macros doc to ic-cdk for doc-tests * fix doc links * ci: add doc step which fail on warnings * fix cache key * bump dependency if major outdated * feat: candid-extractor supports --version (#485) * bump rust to v1.75.0 (same as sdk repo) * bump wasmtime to 19 and cargo update * add clap dependency * submodule extract * clap for --version and --help/-h * add changelog and bump to 0.1.3 * clippy from recent rust has a false positive * e2e test * feat: add API `in_replicated_execution()` (#489) * update ic0.txt * auto-gen files * add the safe wrapper * e2e * Changelog * chore: release 20240510 (#491) * chore: Release 0.14.0 (#494) * Release 0.14.0 * lockfile * ic-ledger-types and changelogs * mark yank * test: use pocket-ic in e2e-tests (#495) * script to download pocket-ic binary * use pocket-ic in e2e tests * fix canister_info * fix test_call_management * fix test_chunk * fix test_cycles_burn * fix test_scheduling_many_timers * fix test_set_global_timers * raise init cycles * ci.yml * cargo update * Revert "cargo update" This reverts commit 6c969d0. * pocket-ic from mono-repo tag * run cargo test on macos too * fix ci * feat: support log_visibility canister setting (#497) * feat!: Stable Memory always use 64-bit addresses and `stable64_*` system API. (#498) * feat!: only use stable64 API * changelog * clippy * chore: release 0.15.0 (#499) * bump ic-cdk to 0.15.0 * bump timers and ledger-types * update README * fix: ld-compatible symbols (#500) * Use ld-compatible symbol in ic-cdk-timers (#503) * feat!: canister state snapshots (#504) * snapshot types * snapshot methods * types cont. * update pocket-ic which support nonmainnet features * e2e test * add LoadSnapshot variant to CanisterChangeDetails * changelog * fix canister_info e2e test * show canister_info after snapshot operations * ci test show output * revert canister_info.rs * revert ci.yml * canister_info changes can have load_snapshot records * chore: update deprecated actions (#507) * docs: clarify post_upgrade argument types (#508) * Improve READMEs * clarify post_upgrade arg type * fix: Fix memory leak in CallFuture (#509) * Release 0.9.3 * Release 0.10.1 * Release 0.11.5 * Release 0.12.2 * Release 0.13.4 * Release 0.14.1 * Release 0.15.1 * chore: release ic-cdk v0.16.0 (#513) * [email protected]: Factor out v2 executor into separate crate (#603) * Release 0.8.3 * Release 0.9.4 * Release 0.10.2 * synthetic commit: 0.11.6+patch * Release 0.11.7 * Release 0.12.3 * synthetic commit: 0.13.5+patch * Release 0.13.6 * Release 0.14.2 * Release 0.15.2 * Release 0.16.1 * pretend this was rebased --------- Co-authored-by: mraszyk <[email protected]> Co-authored-by: Linwei Shang <[email protected]> Co-authored-by: Islam El-Ashi <[email protected]> Co-authored-by: witter-deland <[email protected]> Co-authored-by: AlexandraZapuc <[email protected]> Co-authored-by: Yan Chen <[email protected]> Co-authored-by: Yan Chen <[email protected]> Co-authored-by: Severin Siffert <[email protected]> Co-authored-by: Andriy Berestovskyy <[email protected]> Co-authored-by: Marcin Nowak-Liebiediew <[email protected]> Co-authored-by: maciejdfinity <[email protected]> Co-authored-by: Stefan Kaestle <[email protected]> Co-authored-by: Frederik Rothenberger <[email protected]> Co-authored-by: Ulan Degenbaev <[email protected]> Co-authored-by: Levi <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Hamish Peebles <[email protected]> Co-authored-by: Ulan Degenbaev <[email protected]>
1 parent b77381b commit 919ba40

File tree

143 files changed

+9444
-3157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+9444
-3157
lines changed

.github/workflows/ci.yml

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,102 +5,89 @@ on:
55
branches:
66
- main
77
pull_request:
8+
schedule:
9+
- cron: "0 4 * * 0,3" # 4 a.m. UTC every Sun and Wed, keep actions-cache available
810

911
concurrency:
1012
group: ${{ github.workflow }}-${{ github.ref }}
1113
cancel-in-progress: true
1214

13-
env:
14-
rust-version: 1.66.1
15-
1615
jobs:
1716
build:
1817
name: cargo build
1918
runs-on: ubuntu-latest
2019
steps:
2120
- name: Checkout repository
22-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2322
- name: Cache
24-
uses: actions/cache@v3
23+
uses: actions/cache@v4
2524
with:
2625
path: |
2726
~/.cargo/bin/
2827
~/.cargo/registry/index/
2928
~/.cargo/registry/cache/
3029
~/.cargo/git/db/
3130
target/
32-
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.toml', 'rust-toolchain.toml') }}
31+
key: ${{ runner.os }}-build-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
3332
restore-keys: |
3433
${{ runner.os }}-build-
3534
${{ runner.os }}-
36-
- name: Install Rust
37-
uses: dtolnay/rust-toolchain@v1
38-
with:
39-
toolchain: ${{ env.rust-version }}
40-
target: wasm32-unknown-unknown
4135
- name: Run builds
4236
run: |
43-
cargo build --workspace --exclude ic-cdk-e2e-tests --target wasm32-unknown-unknown
44-
cargo build --workspace --exclude ic-cdk-e2e-tests --target wasm32-unknown-unknown --release
37+
cargo build --workspace --exclude ic-cdk-e2e-tests --exclude candid-extractor --target wasm32-unknown-unknown
38+
cargo build --workspace --exclude ic-cdk-e2e-tests --exclude candid-extractor --target wasm32-unknown-unknown --release
4539
cargo build --example=work
4640
4741
test:
4842
name: cargo test
49-
runs-on: ubuntu-latest
43+
runs-on: ${{ matrix.os }}
44+
strategy:
45+
matrix:
46+
os: [ubuntu-latest, macos-12]
5047
steps:
5148
- name: Checkout repository
52-
uses: actions/checkout@v3
49+
uses: actions/checkout@v4
5350
- name: Cache
54-
uses: actions/cache@v3
51+
uses: actions/cache@v4
5552
with:
5653
path: |
5754
~/.cargo/bin/
5855
~/.cargo/registry/index/
5956
~/.cargo/registry/cache/
6057
~/.cargo/git/db/
6158
target/
62-
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.toml', 'rust-toolchain.toml') }}
59+
key: ${{ runner.os }}-test-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
6360
restore-keys: |
6461
${{ runner.os }}-test-
6562
${{ runner.os }}-
66-
- name: Install Rust
67-
uses: dtolnay/rust-toolchain@v1
68-
with:
69-
toolchain: ${{ env.rust-version }}
70-
- name: Install protoc
71-
run: |
72-
sudo apt-get install -y protobuf-compiler
73-
- name: Download ic-test-state-machine
63+
- name: Download pocket-ic
7464
run: |
75-
bash scripts/download_state_machine_binary.sh
65+
bash scripts/download_pocket_ic.sh
7666
- name: Run tests
77-
run: |
67+
run:
68+
| # https://github.com/rust-lang/cargo/issues/6669 we have to run ALL tests with two commands
7869
cargo test --all-targets
70+
cargo test --doc
7971

8072
fmt:
8173
name: cargo fmt
8274
runs-on: ubuntu-latest
8375
steps:
8476
- name: Checkout repository
85-
uses: actions/checkout@v3
77+
uses: actions/checkout@v4
8678
- name: Cache
87-
uses: actions/cache@v3
79+
uses: actions/cache@v4
8880
with:
8981
path: |
9082
~/.cargo/bin/
9183
~/.cargo/registry/index/
9284
~/.cargo/registry/cache/
9385
~/.cargo/git/db/
9486
target/
95-
key: ${{ runner.os }}-fmt-${{ hashFiles('**/Cargo.toml', 'rust-toolchain.toml') }}
87+
key: ${{ runner.os }}-fmt-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
9688
restore-keys: |
9789
${{ runner.os }}-fmt-
9890
${{ runner.os }}-
99-
- name: Install Rust
100-
uses: dtolnay/rust-toolchain@v1
101-
with:
102-
toolchain: ${{ env.rust-version }}
103-
components: rustfmt
10491
- name: Check formatting
10592
run: |
10693
cargo fmt --all -- --check
@@ -110,36 +97,51 @@ jobs:
11097
runs-on: ubuntu-latest
11198
steps:
11299
- name: Checkout repository
113-
uses: actions/checkout@v3
100+
uses: actions/checkout@v4
114101
- name: Cache
115-
uses: actions/cache@v3
102+
uses: actions/cache@v4
116103
with:
117104
path: |
118105
~/.cargo/bin/
119106
~/.cargo/registry/index/
120107
~/.cargo/registry/cache/
121108
~/.cargo/git/db/
122109
target/
123-
key: ${{ runner.os }}-clippy-${{ hashFiles('**/Cargo.toml', 'rust-toolchain.toml') }}
110+
key: ${{ runner.os }}-clippy-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
124111
restore-keys: |
125112
${{ runner.os }}-clippy-
126113
${{ runner.os }}-
127-
- name: Install Rust
128-
uses: dtolnay/rust-toolchain@v1
129-
with:
130-
toolchain: ${{ env.rust-version }}
131-
components: clippy
132-
- name: Install protoc
133-
run: |
134-
sudo apt-get install -y protobuf-compiler
135114
- name: Run clippy
136115
run: |
137116
cargo clippy --tests --benches -- -D warnings
138117
118+
doc:
119+
name: cargo doc
120+
runs-on: ubuntu-latest
121+
steps:
122+
- name: Checkout repository
123+
uses: actions/checkout@v4
124+
- name: Cache
125+
uses: actions/cache@v4
126+
with:
127+
path: |
128+
~/.cargo/bin/
129+
~/.cargo/registry/index/
130+
~/.cargo/registry/cache/
131+
~/.cargo/git/db/
132+
target/
133+
key: ${{ runner.os }}-doc-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
134+
restore-keys: |
135+
${{ runner.os }}-doc-
136+
${{ runner.os }}-
137+
- name: Run doc
138+
run: |
139+
RUSTDOCFLAGS="-D warnings" cargo doc
140+
139141
aggregate:
140142
name: ci:required
141143
if: ${{ always() }}
142-
needs: [build, test, fmt, clippy]
144+
needs: [build, test, fmt, clippy, doc]
143145
runs-on: ubuntu-latest
144146
steps:
145147
- name: check build result

.github/workflows/conventional-commits.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,24 @@ concurrency:
1414

1515
jobs:
1616
check:
17+
name: conventional-pr-title:required
1718
runs-on: ubuntu-latest
1819
steps:
19-
- uses: dfinity/[email protected]
20-
with:
21-
success-state: Title follows the specification.
22-
failure-state: Title does not follow the specification.
23-
context-name: conventional-pr-title
24-
preset: conventional-changelog-angular@latest
25-
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
# Conventional commit patterns:
21+
# verb: description
22+
# verb!: description of breaking change
23+
# verb(scope): Description of change to $scope
24+
# verb(scope)!: Description of breaking change to $scope
25+
# verb: feat, fix, ...
26+
# scope: refers to the part of code being changed. E.g. " (accounts)" or " (accounts,canisters)"
27+
# !: Indicates that the PR contains a breaking change.
28+
- env:
29+
TITLE: ${{ github.event.pull_request.title }}
30+
run: |
31+
echo "PR title: $TITLE"
32+
if [[ "$TITLE" =~ ^(feat|fix|chore|build|ci|docs|style|refactor|perf|test)(\([-a-zA-Z0-9,]+\))?\!?\: ]]; then
33+
echo pass
34+
else
35+
echo "PR title does not match conventions"
36+
exit 1
37+
fi

.github/workflows/examples.yml

Lines changed: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,48 @@ on:
55
branches:
66
- main
77
pull_request:
8+
schedule:
9+
- cron: "0 4 * * 0,3" # 4 a.m. UTC every Sun and Wed, keep actions-cache available
810

911
concurrency:
1012
group: ${{ github.workflow }}-${{ github.ref }}
1113
cancel-in-progress: true
1214

1315
env:
14-
rust-version: 1.66.1
15-
dfx-version: 0.13.1
16+
ic-wasm-version: 0.4.0
1617

1718
jobs:
19+
build-candid-extractor:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Cache
26+
uses: actions/cache@v4
27+
with:
28+
path: |
29+
~/.cargo/bin/
30+
~/.cargo/registry/index/
31+
~/.cargo/registry/cache/
32+
~/.cargo/git/db/
33+
target/
34+
key: ${{ runner.os }}-candid-extractor-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
35+
restore-keys: |
36+
${{ runner.os }}-candid-extractor-
37+
${{ runner.os }}-
38+
39+
- name: Build candid-extractor
40+
run: cargo build -p candid-extractor --release
41+
42+
- uses: actions/upload-artifact@v4
43+
with:
44+
name: candid-extractor
45+
path: target/release/candid-extractor
46+
1847
test:
1948
runs-on: ubuntu-latest
49+
needs: build-candid-extractor
2050
strategy:
2151
fail-fast: false
2252
matrix:
@@ -25,46 +55,43 @@ jobs:
2555

2656
steps:
2757
- name: Checkout repository
28-
uses: actions/checkout@v3
58+
uses: actions/checkout@v4
59+
with:
60+
submodules: "recursive"
2961

3062
- name: Cache
31-
uses: actions/cache@v3
63+
uses: actions/cache@v4
3264
with:
3365
path: |
3466
~/.cargo/bin/
3567
~/.cargo/registry/index/
3668
~/.cargo/registry/cache/
3769
~/.cargo/git/db/
3870
examples/${{ matrix.project-name }}/target/
39-
key: ${{ runner.os }}-${{ matrix.project-name }}-${{ hashFiles('**/Cargo.toml', 'rust-toolchain.toml') }}
71+
key: ${{ runner.os }}-${{ matrix.project-name }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
4072
restore-keys: |
4173
${{ runner.os }}-${{ matrix.project-name }}-
4274
${{ runner.os }}-
4375
44-
- name: Install Rust
45-
uses: dtolnay/rust-toolchain@v1
46-
with:
47-
toolchain: ${{ env.rust-version }}
48-
target: wasm32-unknown-unknown
49-
components: rustfmt
50-
5176
- name: Install ic-wasm
5277
# might already in cache
5378
run: |
54-
if ! [ -x "$(command -v ic-wasm)" ]; then
55-
cargo install ic-wasm
56-
fi
79+
wget https://github.com/dfinity/ic-wasm/releases/download/${{env.ic-wasm-version }}/ic-wasm-linux64
80+
chmod 755 ic-wasm-linux64
81+
mv ic-wasm-linux64 /usr/local/bin/ic-wasm
5782
58-
- name: Install DFX
83+
- name: Download candid-extractor
84+
uses: actions/download-artifact@v4
85+
with:
86+
name: candid-extractor
87+
88+
- name: Install candid-extractor
5989
run: |
60-
export DFX_VERSION=${{env.dfx-version }}
61-
echo Install DFX v$DFX_VERSION
62-
yes | sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
90+
chmod 755 candid-extractor
91+
mv candid-extractor /usr/local/bin/candid-extractor
6392
64-
- name: Setup BATS
65-
uses: mig4/[email protected]
66-
with:
67-
bats-version: 1.2.1
93+
- name: Install DFX
94+
uses: dfinity/setup-dfx@main
6895

6996
- name: Install bitcoin
7097
if: ${{ matrix.project-name == 'management_canister' }}
@@ -84,11 +111,11 @@ jobs:
84111
- name: Run Tests
85112
shell: bash
86113
run: |
87-
bats -r examples/${{ matrix.project-name }}
114+
./examples/bats/bats-core/bin/bats -r examples/${{ matrix.project-name }}
88115
env:
89116
RUST_BACKTRACE: 1
90117

91-
- name: cargo fmt # no clippy because #[import] makes it fail
118+
- name: cargo fmt # no clippy because build.rs using ic-cdk-bindgen would fail
92119
run: |
93120
pushd examples/${{ matrix.project-name }}
94121
cargo fmt --check

0 commit comments

Comments
 (0)