Skip to content

Commit

Permalink
chore(ci): examples run with latest dfx (#468)
Browse files Browse the repository at this point in the history
* chore: upgrade CI dependencies & use latest in setup-dfx

* chore: correct comment

* fix: add mising export_candid!
  • Loading branch information
lwshang authored Feb 28, 2024
1 parent e630e83 commit f6c1820
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -43,9 +43,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -69,9 +69,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -92,9 +92,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ concurrency:
cancel-in-progress: true

env:
dfx-version: 0.14.1
ic-wasm-version: 0.4.0

jobs:
build-candid-extractor:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -40,7 +39,7 @@ jobs:
- name: Build candid-extractor
run: cargo build -p candid-extractor --release

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: candid-extractor
path: target/release/candid-extractor
Expand All @@ -56,12 +55,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -82,7 +81,7 @@ jobs:
mv ic-wasm-linux64 /usr/local/bin/ic-wasm
- name: Download candid-extractor
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: candid-extractor

Expand All @@ -93,8 +92,6 @@ jobs:
- name: Install DFX
uses: dfinity/setup-dfx@main
with:
dfx-version: "${{ env.dfx-version }}"

- name: Install bitcoin
if: ${{ matrix.project-name == 'management_canister' }}
Expand Down
2 changes: 2 additions & 0 deletions examples/counter/src/inter2_rs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ async fn inc() {
async fn write(input: candid::Nat) {
inter_mo.write(input).await.unwrap()
}

ic_cdk::export_candid!();
2 changes: 2 additions & 0 deletions examples/counter/src/inter_rs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ async fn inc() {
async fn write(input: candid::Nat) {
counter_mo.write(input).await.unwrap()
}

ic_cdk::export_candid!();
2 changes: 2 additions & 0 deletions examples/profile/src/profile_inter_rs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ async fn update(profile: Profile) {
async fn search(text: String) -> Option<Profile> {
profile_rs.search(text).await.unwrap().0
}

ic_cdk::export_candid!();
2 changes: 1 addition & 1 deletion examples/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "stable" # sync with rust-version in root Cargo.toml
channel = "stable" # intentionally not pinned to a specific version
targets = ["wasm32-unknown-unknown"]
components = ["rustfmt", "clippy"]

0 comments on commit f6c1820

Please sign in to comment.