Skip to content

Commit bcd18cc

Browse files
authored
chore: migrate rust/unit_testable_rust_canister to icp-cli (#1405)
1 parent dca7796 commit bcd18cc

18 files changed

Lines changed: 273 additions & 185 deletions

‎.github/workflows/rust-unit-testable-rust-canister-example.yml‎

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: unit_testable_rust_canister
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
paths:
8+
- rust/unit_testable_rust_canister/**
9+
- .github/workflows/unit_testable_rust_canister.yml
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
rust-unit_testable_rust_canister:
17+
runs-on: ubuntu-24.04
18+
container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1
19+
env:
20+
ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
steps:
22+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
23+
- name: Unit tests
24+
working-directory: rust/unit_testable_rust_canister
25+
run: cargo test --package backend --lib
26+
- name: Install PocketIC server
27+
uses: dfinity/pocketic@a980c334fab1b21b0b8a6bba38e1a10836e7258b # main
28+
with:
29+
pocket-ic-server-version: "15.0.0"
30+
- name: Build WASM and run PocketIC integration tests
31+
working-directory: rust/unit_testable_rust_canister
32+
run: |
33+
cargo build --package backend --target wasm32-unknown-unknown --release
34+
cargo test --package backend --test integration_tests
35+
- name: Deploy and test
36+
working-directory: rust/unit_testable_rust_canister
37+
run: |
38+
icp network start -d
39+
icp deploy
40+
bash test.sh

‎rust/unit_testable_rust_canister/Cargo.lock‎

Lines changed: 65 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎rust/unit_testable_rust_canister/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
members = [
3-
"src/hello_canister",
3+
"backend",
44
]
55
resolver = "2"
66

0 commit comments

Comments
 (0)