From 5fb4c88269d444a511a8f7ab8556658b5c64f907 Mon Sep 17 00:00:00 2001 From: Marco Walz Date: Wed, 22 Jul 2026 13:58:46 +0200 Subject: [PATCH 1/4] ci: centralize dev-env image version via reusable workflow (PoC on hello_world) Introduce .github/workflows/run-example.yml, a reusable (workflow_call) workflow that runs an example's CI steps inside the ICP dev-env container. It is the single source of truth for the dev-env image version in CI; callers pass the language (image variant), working directory, and commands. Convert hello_world to a thin caller as a proof of concept, bump the devcontainer to icp-dev-env-all:1.1.0, and add dev-env-version-check.yml to guard that the devcontainer and the reusable workflow stay on the same version. Co-Authored-By: Claude Opus 4.8 (1M context) --- .devcontainer/devcontainer.json | 2 +- .github/workflows/dev-env-version-check.yml | 36 +++++++++++++++ .github/workflows/hello_world.yml | 45 ++++++++----------- .github/workflows/run-example.yml | 49 +++++++++++++++++++++ 4 files changed, 105 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/dev-env-version-check.yml create mode 100644 .github/workflows/run-example.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b2a5681d8f..a80ccc8c22 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { "name": "ICP Examples (Motoko + Rust)", - "image": "ghcr.io/dfinity/icp-dev-env-all:0.3.1", + "image": "ghcr.io/dfinity/icp-dev-env-all:1.1.0", "forwardPorts": [8000, 5173], "portsAttributes": { "8000": { diff --git a/.github/workflows/dev-env-version-check.yml b/.github/workflows/dev-env-version-check.yml new file mode 100644 index 0000000000..9b92b18b50 --- /dev/null +++ b/.github/workflows/dev-env-version-check.yml @@ -0,0 +1,36 @@ +# Guards that the dev-env image version is consistent across the two places it +# is defined: the CI reusable workflow (run-example.yml) and the devcontainer +# (.devcontainer/devcontainer.json). Fails the PR if they drift apart. +name: dev-env-version-check + +on: + pull_request: + paths: + - .devcontainer/devcontainer.json + - .github/workflows/run-example.yml + - .github/workflows/dev-env-version-check.yml + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + check: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - name: Compare dev-env image versions + run: | + devcontainer_version=$(jq -r '.image' .devcontainer/devcontainer.json | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') + ci_version=$(grep -E 'container:.*icp-dev-env' .github/workflows/run-example.yml | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) + echo "devcontainer.json: ${devcontainer_version:-}" + echo "run-example.yml: ${ci_version:-}" + if [ -z "$devcontainer_version" ] || [ -z "$ci_version" ]; then + echo "::error::Could not extract a dev-env image version from one of the files." + exit 1 + fi + if [ "$devcontainer_version" != "$ci_version" ]; then + echo "::error::dev-env image version mismatch: devcontainer.json=$devcontainer_version vs run-example.yml=$ci_version. Update both to the same version." + exit 1 + fi + echo "dev-env image versions are consistent ($ci_version)." diff --git a/.github/workflows/hello_world.yml b/.github/workflows/hello_world.yml index 61c9865670..5804097519 100644 --- a/.github/workflows/hello_world.yml +++ b/.github/workflows/hello_world.yml @@ -9,36 +9,29 @@ on: - motoko/hello_world/** - rust/hello_world/** - .github/workflows/hello_world.yml + - .github/workflows/run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - motoko-hello_world: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/hello_world - run: | - icp network start -d - icp deploy - bash test.sh + motoko: + uses: ./.github/workflows/run-example.yml + with: + language: motoko + working-directory: motoko/hello_world + run: | + icp network start -d + icp deploy + bash test.sh - rust-hello_world: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/hello_world - run: | - icp network start -d - icp deploy - bash test.sh + rust: + uses: ./.github/workflows/run-example.yml + with: + language: rust + working-directory: rust/hello_world + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/run-example.yml b/.github/workflows/run-example.yml new file mode 100644 index 0000000000..97a172933d --- /dev/null +++ b/.github/workflows/run-example.yml @@ -0,0 +1,49 @@ +# Reusable workflow that runs an example's CI steps inside the ICP dev-env container. +# +# This is the single source of truth for the dev-env image version used in CI. +# It is kept in sync with .devcontainer/devcontainer.json by dev-env-version-check.yml. +# +# Callers provide the language (which selects the image variant), the working +# directory, and the commands to run. Example: +# +# jobs: +# motoko: +# uses: ./.github/workflows/run-example.yml +# with: +# language: motoko +# working-directory: motoko/hello_world +# run: | +# icp network start -d +# icp deploy +# bash test.sh +name: run-example + +on: + workflow_call: + inputs: + language: + description: "Dev-env image variant to run in: motoko | rust | all" + type: string + required: true + working-directory: + description: "Path to the example directory to run the commands in" + type: string + required: true + run: + description: "Commands to execute inside the dev-env container" + type: string + default: | + icp network start -d + icp deploy + +jobs: + run: + runs-on: ubuntu-24.04 + container: ghcr.io/dfinity/icp-dev-env-${{ inputs.language }}:1.1.0 + env: + ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - name: Run + working-directory: ${{ inputs.working-directory }} + run: ${{ inputs.run }} From f683bb5c41f245df6306884b9c2289ea2fcd3c35 Mon Sep 17 00:00:00 2001 From: Marco Walz Date: Wed, 22 Jul 2026 15:18:12 +0200 Subject: [PATCH 2/4] ci: sweep all example workflows to the reusable _run-example.yml pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert every example workflow to call the reusable _run-example.yml, so no workflow hardcodes the dev-env image version anymore — the version lives only in _run-example.yml and .devcontainer/devcontainer.json (guarded by dev-env-version-check.yml). Each caller passes language, working-directory, and the commands to run; extra setup steps (apt installs, rustup targets, model downloads) are folded into the run block, and PocketIC integration tests use the new install-pocketic input. Also fix image variants: frontend-only examples (hosting/react, hosting/oisy- signer-demo) now use the `all` image like the other hosting examples, instead of the motoko image. Update workflow-template.yml to the caller pattern. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflow-template.yml | 34 +++++---- .../{run-example.yml => _run-example.yml} | 20 ++++- .github/workflows/backend_only.yml | 41 +++++----- .github/workflows/backend_wasm64.yml | 22 +++--- .github/workflows/basic_ethereum.yml | 21 +++-- .github/workflows/candid_type_generation.yml | 21 +++-- .github/workflows/canister-info.yml | 21 +++-- .../workflows/canister-snapshot-download.yml | 21 +++-- .github/workflows/canister-snapshots.yml | 21 +++-- .github/workflows/canister_factory.yml | 21 +++-- .github/workflows/canister_logs.yml | 41 +++++----- .github/workflows/cert-var.yml | 21 +++-- .github/workflows/composite_query.yml | 41 +++++----- .github/workflows/daily_planner.yml | 41 +++++----- .github/workflows/dev-env-version-check.yml | 10 +-- .github/workflows/evm_block_explorer.yml | 41 +++++----- .github/workflows/exchange-rates.yml | 21 +++-- .github/workflows/face-recognition.yml | 24 +++--- .github/workflows/filevault.yml | 21 +++-- .github/workflows/flying_ninja.yml | 41 +++++----- .github/workflows/guards.yml | 34 ++++----- .github/workflows/hello_cycles.yml | 21 +++-- .github/workflows/hello_world.yml | 6 +- .../hosting-godot-html5-template-example.yml | 19 ++--- .../hosting-photo-storage-example.yml | 19 ++--- .../hosting-static-website-example.yaml | 19 ++--- .../hosting-unity-webgl-example.yaml | 19 ++--- .github/workflows/ic_pos.yml | 21 +++-- .github/workflows/icp_transfer.yml | 41 +++++----- .github/workflows/icrc2-swap.yml | 21 +++-- .github/workflows/image-classification.yml | 36 ++++----- .github/workflows/inter-canister-calls.yml | 21 +++-- .github/workflows/llm_chatbot.yml | 37 ++++----- .github/workflows/low_wasm_memory.yml | 41 +++++----- .github/workflows/oisy_signer_demo.yml | 20 +++-- .github/workflows/parallel_calls.yml | 76 ++++++++----------- .github/workflows/performance_counters.yml | 21 +++-- .github/workflows/periodic_tasks.yml | 21 +++-- .github/workflows/photo_gallery.yml | 21 +++-- .github/workflows/pub-sub.yml | 21 +++-- .github/workflows/qrcode.yml | 21 +++-- .github/workflows/query_stats.yml | 41 +++++----- .github/workflows/random_maze.yml | 21 +++-- .github/workflows/react.yml | 20 +++-- .github/workflows/receiving-icp.yml | 21 +++-- .github/workflows/send_http_get.yml | 41 +++++----- .github/workflows/send_http_post.yml | 41 +++++----- .github/workflows/simd.yml | 21 +++-- .github/workflows/stake_neuron_from_cli.yml | 19 ++--- .github/workflows/superheroes.yml | 21 +++-- .github/workflows/threshold-ecdsa.yml | 41 +++++----- .github/workflows/threshold-schnorr.yml | 57 +++++--------- .../workflows/unit_testable_rust_canister.yml | 37 ++++----- .github/workflows/unity_ii_deeplink.yml | 21 +++-- .../workflows/vetkeys-basic-bls-signing.yml | 37 ++++----- .github/workflows/vetkeys-basic-ibe.yml | 37 ++++----- .../workflows/vetkeys-basic-timelock-ibe.yml | 16 ++-- .github/workflows/vetkeys-basic-vetkd.yml | 41 +++++----- .../vetkeys-encrypted-notes-app-vetkd.yml | 37 ++++----- ...vetkeys-password-manager-with-metadata.yml | 32 ++++---- .../workflows/vetkeys-password-manager.yml | 37 ++++----- .github/workflows/wasm_counter.yml | 24 +++--- .github/workflows/who_am_i.yml | 41 +++++----- .github/workflows/x509.yml | 36 ++++----- 64 files changed, 778 insertions(+), 1063 deletions(-) rename .github/workflows/{run-example.yml => _run-example.yml} (65%) diff --git a/.github/workflow-template.yml b/.github/workflow-template.yml index fdd5376759..cd7938621b 100644 --- a/.github/workflow-template.yml +++ b/.github/workflow-template.yml @@ -1,10 +1,17 @@ # Workflow template for ICP examples. # Copy this file to .github/workflows/.yml and replace the placeholders. # +# Examples run inside the ICP dev-env container via the reusable _run-example.yml +# workflow, which is the single source of truth for the dev-env image version. +# # PLACEHOLDERS: # e.g. hello_world -# motoko | rust -# ghcr.io/dfinity/icp-dev-env-motoko | ghcr.io/dfinity/icp-dev-env-rust +# motoko | rust | all (use "all" for frontend-only examples) +# e.g. motoko/hello_world (for frontend-only: hosting/) +# +# For a two-language example, add one job per language (e.g. motoko- +# and rust-). Examples that need a PocketIC server for integration +# tests can set `install-pocketic: true` (and optionally `pocketic-version`). name: @@ -14,8 +21,9 @@ on: - master pull_request: paths: - - //** + - /** - .github/workflows/.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -23,15 +31,11 @@ concurrency: jobs: -: - runs-on: ubuntu-24.04 - container: - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: / - run: | - icp network start -d - icp deploy - make test + uses: ./.github/workflows/_run-example.yml + with: + language: + working-directory: + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/run-example.yml b/.github/workflows/_run-example.yml similarity index 65% rename from .github/workflows/run-example.yml rename to .github/workflows/_run-example.yml index 97a172933d..6c1e93b114 100644 --- a/.github/workflows/run-example.yml +++ b/.github/workflows/_run-example.yml @@ -7,8 +7,8 @@ # directory, and the commands to run. Example: # # jobs: -# motoko: -# uses: ./.github/workflows/run-example.yml +# motoko-hello_world: +# uses: ./.github/workflows/_run-example.yml # with: # language: motoko # working-directory: motoko/hello_world @@ -16,6 +16,9 @@ # icp network start -d # icp deploy # bash test.sh +# +# Examples that need a PocketIC server for integration tests set +# install-pocketic: true (optionally overriding pocketic-version). name: run-example on: @@ -35,6 +38,14 @@ on: default: | icp network start -d icp deploy + install-pocketic: + description: "Install the PocketIC server before running the commands" + type: boolean + default: false + pocketic-version: + description: "PocketIC server version to install when install-pocketic is true" + type: string + default: "15.0.0" jobs: run: @@ -44,6 +55,11 @@ jobs: ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - name: Install PocketIC server + if: ${{ inputs.install-pocketic }} + uses: dfinity/pocketic@a980c334fab1b21b0b8a6bba38e1a10836e7258b # main + with: + pocket-ic-server-version: ${{ inputs.pocketic-version }} - name: Run working-directory: ${{ inputs.working-directory }} run: ${{ inputs.run }} diff --git a/.github/workflows/backend_only.yml b/.github/workflows/backend_only.yml index fc7d58a1d2..36ea3f797a 100644 --- a/.github/workflows/backend_only.yml +++ b/.github/workflows/backend_only.yml @@ -8,6 +8,7 @@ on: - motoko/backend_only/** - rust/backend_only/** - .github/workflows/backend_only.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,29 +16,21 @@ concurrency: jobs: motoko-backend_only: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/backend_only - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/backend_only + run: | + icp network start -d + icp deploy + bash test.sh rust-backend_only: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/backend_only - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/backend_only + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/backend_wasm64.yml b/.github/workflows/backend_wasm64.yml index 068868535e..36289852ea 100644 --- a/.github/workflows/backend_wasm64.yml +++ b/.github/workflows/backend_wasm64.yml @@ -6,20 +6,18 @@ on: paths: - rust/backend_wasm64/** - .github/workflows/backend_wasm64.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true + jobs: rust-backend_wasm64: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/backend_wasm64 - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/backend_wasm64 + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/basic_ethereum.yml b/.github/workflows/basic_ethereum.yml index 8382913431..780f49f8e8 100644 --- a/.github/workflows/basic_ethereum.yml +++ b/.github/workflows/basic_ethereum.yml @@ -7,6 +7,7 @@ on: paths: - rust/basic_ethereum/** - .github/workflows/basic_ethereum.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: rust-basic_ethereum: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/basic_ethereum - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/basic_ethereum + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/candid_type_generation.yml b/.github/workflows/candid_type_generation.yml index f7a2628f89..a7c2e199b5 100644 --- a/.github/workflows/candid_type_generation.yml +++ b/.github/workflows/candid_type_generation.yml @@ -8,6 +8,7 @@ on: paths: - rust/candid_type_generation/** - .github/workflows/candid_type_generation.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,15 +16,11 @@ concurrency: jobs: rust-candid_type_generation: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/candid_type_generation - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/candid_type_generation + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/canister-info.yml b/.github/workflows/canister-info.yml index 5578839c6c..71500bd065 100644 --- a/.github/workflows/canister-info.yml +++ b/.github/workflows/canister-info.yml @@ -7,6 +7,7 @@ on: paths: - rust/canister-info/** - .github/workflows/canister-info.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: rust-canister-info: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/canister-info - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/canister-info + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/canister-snapshot-download.yml b/.github/workflows/canister-snapshot-download.yml index 52ebc87b70..2dfcc30779 100644 --- a/.github/workflows/canister-snapshot-download.yml +++ b/.github/workflows/canister-snapshot-download.yml @@ -7,6 +7,7 @@ on: paths: - rust/canister-snapshot-download/** - .github/workflows/canister-snapshot-download.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: rust-canister-snapshot-download: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/canister-snapshot-download - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/canister-snapshot-download + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/canister-snapshots.yml b/.github/workflows/canister-snapshots.yml index b200c963d0..6ccbb45309 100644 --- a/.github/workflows/canister-snapshots.yml +++ b/.github/workflows/canister-snapshots.yml @@ -7,6 +7,7 @@ on: paths: - rust/canister-snapshots/** - .github/workflows/canister-snapshots.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: rust-canister-snapshots: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/canister-snapshots - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/canister-snapshots + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/canister_factory.yml b/.github/workflows/canister_factory.yml index 7b90a5b138..f7dd2f5a3a 100644 --- a/.github/workflows/canister_factory.yml +++ b/.github/workflows/canister_factory.yml @@ -7,6 +7,7 @@ on: paths: - motoko/canister_factory/** - .github/workflows/canister_factory.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: motoko-canister_factory: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/canister_factory - run: | - icp network start -d - icp deploy --cycles 30t - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/canister_factory + run: | + icp network start -d + icp deploy --cycles 30t + bash test.sh diff --git a/.github/workflows/canister_logs.yml b/.github/workflows/canister_logs.yml index 7fc256f692..134f1f60d6 100644 --- a/.github/workflows/canister_logs.yml +++ b/.github/workflows/canister_logs.yml @@ -8,6 +8,7 @@ on: - motoko/canister_logs/** - rust/canister_logs/** - .github/workflows/canister_logs.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,29 +16,21 @@ concurrency: jobs: motoko-canister_logs: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/canister_logs - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/canister_logs + run: | + icp network start -d + icp deploy + bash test.sh rust-canister_logs: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/canister_logs - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/canister_logs + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/cert-var.yml b/.github/workflows/cert-var.yml index 51d45efbfa..b0a12b41f1 100644 --- a/.github/workflows/cert-var.yml +++ b/.github/workflows/cert-var.yml @@ -7,6 +7,7 @@ on: paths: - motoko/cert-var/** - .github/workflows/cert-var.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: motoko-cert-var: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/cert-var - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/cert-var + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/composite_query.yml b/.github/workflows/composite_query.yml index 9a99937ce8..31430f9f51 100644 --- a/.github/workflows/composite_query.yml +++ b/.github/workflows/composite_query.yml @@ -8,6 +8,7 @@ on: - motoko/composite_query/** - rust/composite_query/** - .github/workflows/composite_query.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,29 +16,21 @@ concurrency: jobs: motoko-composite_query: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/composite_query - run: | - icp network start -d - icp deploy --cycles 30t - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/composite_query + run: | + icp network start -d + icp deploy --cycles 30t + bash test.sh rust-composite_query: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/composite_query - run: | - icp network start -d - icp deploy --cycles 30t - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/composite_query + run: | + icp network start -d + icp deploy --cycles 30t + bash test.sh diff --git a/.github/workflows/daily_planner.yml b/.github/workflows/daily_planner.yml index 0d53849d60..198e6bf611 100644 --- a/.github/workflows/daily_planner.yml +++ b/.github/workflows/daily_planner.yml @@ -9,6 +9,7 @@ on: - motoko/daily_planner/** - rust/daily_planner/** - .github/workflows/daily_planner.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -16,29 +17,21 @@ concurrency: jobs: motoko-daily_planner: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/daily_planner - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/daily_planner + run: | + icp network start -d + icp deploy + bash test.sh rust-daily_planner: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/daily_planner - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/daily_planner + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/dev-env-version-check.yml b/.github/workflows/dev-env-version-check.yml index 9b92b18b50..7c148b70ee 100644 --- a/.github/workflows/dev-env-version-check.yml +++ b/.github/workflows/dev-env-version-check.yml @@ -1,5 +1,5 @@ # Guards that the dev-env image version is consistent across the two places it -# is defined: the CI reusable workflow (run-example.yml) and the devcontainer +# is defined: the CI reusable workflow (_run-example.yml) and the devcontainer # (.devcontainer/devcontainer.json). Fails the PR if they drift apart. name: dev-env-version-check @@ -7,7 +7,7 @@ on: pull_request: paths: - .devcontainer/devcontainer.json - - .github/workflows/run-example.yml + - .github/workflows/_run-example.yml - .github/workflows/dev-env-version-check.yml concurrency: @@ -22,15 +22,15 @@ jobs: - name: Compare dev-env image versions run: | devcontainer_version=$(jq -r '.image' .devcontainer/devcontainer.json | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') - ci_version=$(grep -E 'container:.*icp-dev-env' .github/workflows/run-example.yml | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) + ci_version=$(grep -E 'container:.*icp-dev-env' .github/workflows/_run-example.yml | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) echo "devcontainer.json: ${devcontainer_version:-}" - echo "run-example.yml: ${ci_version:-}" + echo "_run-example.yml: ${ci_version:-}" if [ -z "$devcontainer_version" ] || [ -z "$ci_version" ]; then echo "::error::Could not extract a dev-env image version from one of the files." exit 1 fi if [ "$devcontainer_version" != "$ci_version" ]; then - echo "::error::dev-env image version mismatch: devcontainer.json=$devcontainer_version vs run-example.yml=$ci_version. Update both to the same version." + echo "::error::dev-env image version mismatch: devcontainer.json=$devcontainer_version vs _run-example.yml=$ci_version. Update both to the same version." exit 1 fi echo "dev-env image versions are consistent ($ci_version)." diff --git a/.github/workflows/evm_block_explorer.yml b/.github/workflows/evm_block_explorer.yml index 6a8913a7ec..a6686aae48 100644 --- a/.github/workflows/evm_block_explorer.yml +++ b/.github/workflows/evm_block_explorer.yml @@ -8,6 +8,7 @@ on: - motoko/evm_block_explorer/** - rust/evm_block_explorer/** - .github/workflows/evm_block_explorer.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,29 +16,21 @@ concurrency: jobs: motoko-evm_block_explorer: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/evm_block_explorer - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/evm_block_explorer + run: | + icp network start -d + icp deploy + bash test.sh rust-evm_block_explorer: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/evm_block_explorer - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/evm_block_explorer + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/exchange-rates.yml b/.github/workflows/exchange-rates.yml index 6456760f23..50e94ad150 100644 --- a/.github/workflows/exchange-rates.yml +++ b/.github/workflows/exchange-rates.yml @@ -7,6 +7,7 @@ on: paths: - rust/exchange-rates/** - .github/workflows/exchange-rates.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: rust-exchange-rates: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/exchange-rates - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/exchange-rates + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/face-recognition.yml b/.github/workflows/face-recognition.yml index 2e4314e8d9..957db5ab08 100644 --- a/.github/workflows/face-recognition.yml +++ b/.github/workflows/face-recognition.yml @@ -7,6 +7,7 @@ on: paths: - rust/face-recognition/** - .github/workflows/face-recognition.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,17 +15,12 @@ concurrency: jobs: rust-face-recognition: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Install build dependencies - run: apt-get update && apt-get install -y --no-install-recommends build-essential - - name: Deploy and test - working-directory: rust/face-recognition - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/face-recognition + run: | + apt-get update && apt-get install -y --no-install-recommends build-essential + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/filevault.yml b/.github/workflows/filevault.yml index a922cfdc45..fcee296c53 100644 --- a/.github/workflows/filevault.yml +++ b/.github/workflows/filevault.yml @@ -7,6 +7,7 @@ on: paths: - motoko/filevault/** - .github/workflows/filevault.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: motoko-filevault: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/filevault - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/filevault + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/flying_ninja.yml b/.github/workflows/flying_ninja.yml index 3c5f217a72..ceec1032d5 100644 --- a/.github/workflows/flying_ninja.yml +++ b/.github/workflows/flying_ninja.yml @@ -8,6 +8,7 @@ on: - motoko/flying_ninja/** - rust/flying_ninja/** - .github/workflows/flying_ninja.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,29 +16,21 @@ concurrency: jobs: motoko-flying_ninja: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/flying_ninja - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/flying_ninja + run: | + icp network start -d + icp deploy + bash test.sh rust-flying_ninja: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/flying_ninja - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/flying_ninja + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/guards.yml b/.github/workflows/guards.yml index 2de521c4c8..971ada4724 100644 --- a/.github/workflows/guards.yml +++ b/.github/workflows/guards.yml @@ -7,6 +7,7 @@ on: paths: - rust/guards/** - .github/workflows/guards.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,24 +15,15 @@ concurrency: jobs: rust-guards: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test (icp-cli) - working-directory: rust/guards - run: | - icp network start -d - icp deploy - bash test.sh - - name: Install PocketIC server - uses: dfinity/pocketic@07bfae058ce2aa56994759b563531a7e8d98ba96 # main - with: - pocket-ic-server-version: "14.0.0" - - name: Build WASM and run PocketIC tests - working-directory: rust/guards - run: | - cargo build --package backend --target wasm32-unknown-unknown --release - cargo test --package backend + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/guards + run: | + icp network start -d + icp deploy + bash test.sh + cargo build --package backend --target wasm32-unknown-unknown --release + cargo test --package backend + install-pocketic: true + pocketic-version: "14.0.0" diff --git a/.github/workflows/hello_cycles.yml b/.github/workflows/hello_cycles.yml index e083eb75f7..2c4d043c18 100644 --- a/.github/workflows/hello_cycles.yml +++ b/.github/workflows/hello_cycles.yml @@ -7,6 +7,7 @@ on: paths: - motoko/hello_cycles/** - .github/workflows/hello_cycles.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: motoko-hello_cycles: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/hello_cycles - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/hello_cycles + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/hello_world.yml b/.github/workflows/hello_world.yml index 5804097519..c2b0ca19bd 100644 --- a/.github/workflows/hello_world.yml +++ b/.github/workflows/hello_world.yml @@ -9,7 +9,7 @@ on: - motoko/hello_world/** - rust/hello_world/** - .github/workflows/hello_world.yml - - .github/workflows/run-example.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -17,7 +17,7 @@ concurrency: jobs: motoko: - uses: ./.github/workflows/run-example.yml + uses: ./.github/workflows/_run-example.yml with: language: motoko working-directory: motoko/hello_world @@ -27,7 +27,7 @@ jobs: bash test.sh rust: - uses: ./.github/workflows/run-example.yml + uses: ./.github/workflows/_run-example.yml with: language: rust working-directory: rust/hello_world diff --git a/.github/workflows/hosting-godot-html5-template-example.yml b/.github/workflows/hosting-godot-html5-template-example.yml index 33f4045d00..05d6c630cc 100644 --- a/.github/workflows/hosting-godot-html5-template-example.yml +++ b/.github/workflows/hosting-godot-html5-template-example.yml @@ -7,6 +7,7 @@ on: paths: - hosting/godot-html5-template/** - .github/workflows/hosting-godot-html5-template-example.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,14 +15,10 @@ concurrency: jobs: hosting-godot-html5-template: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-all:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: hosting/godot-html5-template - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: all + working-directory: hosting/godot-html5-template + run: | + icp network start -d + icp deploy diff --git a/.github/workflows/hosting-photo-storage-example.yml b/.github/workflows/hosting-photo-storage-example.yml index dba93c174b..0ac51b738b 100644 --- a/.github/workflows/hosting-photo-storage-example.yml +++ b/.github/workflows/hosting-photo-storage-example.yml @@ -7,6 +7,7 @@ on: paths: - hosting/photo-storage/** - .github/workflows/hosting-photo-storage-example.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,14 +15,10 @@ concurrency: jobs: hosting-photo-storage: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-all:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: hosting/photo-storage - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: all + working-directory: hosting/photo-storage + run: | + icp network start -d + icp deploy diff --git a/.github/workflows/hosting-static-website-example.yaml b/.github/workflows/hosting-static-website-example.yaml index 36bf2881cd..5af9e88e21 100644 --- a/.github/workflows/hosting-static-website-example.yaml +++ b/.github/workflows/hosting-static-website-example.yaml @@ -7,6 +7,7 @@ on: paths: - hosting/static-website/** - .github/workflows/hosting-static-website-example.yaml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,14 +15,10 @@ concurrency: jobs: hosting-static-website: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-all:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: hosting/static-website - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: all + working-directory: hosting/static-website + run: | + icp network start -d + icp deploy diff --git a/.github/workflows/hosting-unity-webgl-example.yaml b/.github/workflows/hosting-unity-webgl-example.yaml index b0747c7c59..24f6ad8fab 100644 --- a/.github/workflows/hosting-unity-webgl-example.yaml +++ b/.github/workflows/hosting-unity-webgl-example.yaml @@ -7,6 +7,7 @@ on: paths: - hosting/unity-webgl-template/** - .github/workflows/hosting-unity-webgl-example.yaml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,14 +15,10 @@ concurrency: jobs: hosting-unity-webgl: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-all:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: hosting/unity-webgl-template - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: all + working-directory: hosting/unity-webgl-template + run: | + icp network start -d + icp deploy diff --git a/.github/workflows/ic_pos.yml b/.github/workflows/ic_pos.yml index 6ece646c42..cc152a7d67 100644 --- a/.github/workflows/ic_pos.yml +++ b/.github/workflows/ic_pos.yml @@ -7,6 +7,7 @@ on: paths: - motoko/ic-pos/** - .github/workflows/ic_pos.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: motoko-ic_pos: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/ic-pos - run: | - icp network start -d - bash deploy.sh - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/ic-pos + run: | + icp network start -d + bash deploy.sh + bash test.sh diff --git a/.github/workflows/icp_transfer.yml b/.github/workflows/icp_transfer.yml index 61285c501b..92b0daaeed 100644 --- a/.github/workflows/icp_transfer.yml +++ b/.github/workflows/icp_transfer.yml @@ -8,6 +8,7 @@ on: - motoko/icp_transfer/** - rust/icp_transfer/** - .github/workflows/icp_transfer.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,29 +16,21 @@ concurrency: jobs: motoko-icp_transfer: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/icp_transfer - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/icp_transfer + run: | + icp network start -d + icp deploy + bash test.sh rust-icp_transfer: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/icp_transfer - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/icp_transfer + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/icrc2-swap.yml b/.github/workflows/icrc2-swap.yml index 186bfae10b..a19f587dc1 100644 --- a/.github/workflows/icrc2-swap.yml +++ b/.github/workflows/icrc2-swap.yml @@ -7,6 +7,7 @@ on: paths: - motoko/icrc2-swap/** - .github/workflows/icrc2-swap.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: motoko-icrc2-swap: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/icrc2-swap - run: | - icp network start -d - bash deploy.sh - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/icrc2-swap + run: | + icp network start -d + bash deploy.sh + bash test.sh diff --git a/.github/workflows/image-classification.yml b/.github/workflows/image-classification.yml index 57103aef96..448d66e3c3 100644 --- a/.github/workflows/image-classification.yml +++ b/.github/workflows/image-classification.yml @@ -8,6 +8,7 @@ on: paths: - rust/image-classification/** - .github/workflows/image-classification.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,25 +16,16 @@ concurrency: jobs: rust-image-classification: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Install wasm32-wasip1 target - run: rustup target add wasm32-wasip1 - - name: Install wasi2ic - run: | - apt-get update && apt-get install -y --no-install-recommends build-essential - git clone https://github.com/wasm-forge/wasi2ic /tmp/wasi2ic - cargo install --path /tmp/wasi2ic --locked - - name: Download model - working-directory: rust/image-classification - run: ./download_model.sh - - name: Deploy and test - working-directory: rust/image-classification - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/image-classification + run: | + rustup target add wasm32-wasip1 + apt-get update && apt-get install -y --no-install-recommends build-essential + git clone https://github.com/wasm-forge/wasi2ic /tmp/wasi2ic + cargo install --path /tmp/wasi2ic --locked + ./download_model.sh + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/inter-canister-calls.yml b/.github/workflows/inter-canister-calls.yml index 8d8d6321c0..843f36f057 100644 --- a/.github/workflows/inter-canister-calls.yml +++ b/.github/workflows/inter-canister-calls.yml @@ -7,6 +7,7 @@ on: paths: - rust/inter-canister-calls/** - .github/workflows/inter-canister-calls.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: rust-inter-canister-calls: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/inter-canister-calls - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/inter-canister-calls + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/llm_chatbot.yml b/.github/workflows/llm_chatbot.yml index 94f6165340..048380bc31 100644 --- a/.github/workflows/llm_chatbot.yml +++ b/.github/workflows/llm_chatbot.yml @@ -8,6 +8,7 @@ on: - motoko/llm_chatbot/** - rust/llm_chatbot/** - .github/workflows/llm_chatbot.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,27 +16,19 @@ concurrency: jobs: motoko-llm_chatbot: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: motoko/llm_chatbot - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/llm_chatbot + run: | + icp network start -d + icp deploy rust-llm_chatbot: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: rust/llm_chatbot - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/llm_chatbot + run: | + icp network start -d + icp deploy diff --git a/.github/workflows/low_wasm_memory.yml b/.github/workflows/low_wasm_memory.yml index 51f3f210ca..fe0a2945e8 100644 --- a/.github/workflows/low_wasm_memory.yml +++ b/.github/workflows/low_wasm_memory.yml @@ -8,6 +8,7 @@ on: - motoko/low_wasm_memory/** - rust/low_wasm_memory/** - .github/workflows/low_wasm_memory.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,29 +16,21 @@ concurrency: jobs: motoko-low_wasm_memory: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/low_wasm_memory - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/low_wasm_memory + run: | + icp network start -d + icp deploy + bash test.sh rust-low_wasm_memory: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/low_wasm_memory - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/low_wasm_memory + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/oisy_signer_demo.yml b/.github/workflows/oisy_signer_demo.yml index e20770d550..1e2be9553f 100644 --- a/.github/workflows/oisy_signer_demo.yml +++ b/.github/workflows/oisy_signer_demo.yml @@ -6,19 +6,17 @@ on: paths: - hosting/oisy-signer-demo/** - .github/workflows/oisy_signer_demo.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true + jobs: oisy_signer_demo: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: hosting/oisy-signer-demo - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: all + working-directory: hosting/oisy-signer-demo + run: | + icp network start -d + icp deploy diff --git a/.github/workflows/parallel_calls.yml b/.github/workflows/parallel_calls.yml index 8d2f360f47..d14193fa5c 100644 --- a/.github/workflows/parallel_calls.yml +++ b/.github/workflows/parallel_calls.yml @@ -8,6 +8,7 @@ on: - motoko/parallel_calls/** - rust/parallel_calls/** - .github/workflows/parallel_calls.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,55 +16,38 @@ concurrency: jobs: motoko-parallel_calls: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/parallel_calls - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/parallel_calls + run: | + icp network start -d + icp deploy + bash test.sh motoko-parallel_calls-multi-subnet: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-all:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Run multi-subnet PocketIC test - working-directory: motoko/parallel_calls - run: bash test-multi-subnet.sh + uses: ./.github/workflows/_run-example.yml + with: + language: all + working-directory: motoko/parallel_calls + run: | + bash test-multi-subnet.sh rust-parallel_calls: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/parallel_calls - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/parallel_calls + run: | + icp network start -d + icp deploy + bash test.sh rust-parallel_calls-multi-subnet: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Install PocketIC server - uses: dfinity/pocketic@a980c334fab1b21b0b8a6bba38e1a10836e7258b # main - with: - pocket-ic-server-version: "15.0.0" - - name: Run multi-subnet PocketIC test - working-directory: rust/parallel_calls - run: bash test-multi-subnet.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/parallel_calls + run: | + bash test-multi-subnet.sh + install-pocketic: true diff --git a/.github/workflows/performance_counters.yml b/.github/workflows/performance_counters.yml index 5cca8072e6..ea1b61a939 100644 --- a/.github/workflows/performance_counters.yml +++ b/.github/workflows/performance_counters.yml @@ -7,6 +7,7 @@ on: paths: - rust/performance_counters/** - .github/workflows/performance_counters.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: rust-performance_counters: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/performance_counters - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/performance_counters + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/periodic_tasks.yml b/.github/workflows/periodic_tasks.yml index aeab73fa84..3eb0e95baa 100644 --- a/.github/workflows/periodic_tasks.yml +++ b/.github/workflows/periodic_tasks.yml @@ -7,6 +7,7 @@ on: paths: - rust/periodic_tasks/** - .github/workflows/periodic_tasks.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: rust-periodic_tasks: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/periodic_tasks - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/periodic_tasks + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/photo_gallery.yml b/.github/workflows/photo_gallery.yml index 852f5d5b04..0f31713588 100644 --- a/.github/workflows/photo_gallery.yml +++ b/.github/workflows/photo_gallery.yml @@ -8,6 +8,7 @@ on: paths: - rust/photo_gallery/** - .github/workflows/photo_gallery.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,15 +16,11 @@ concurrency: jobs: rust-photo_gallery: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/photo_gallery - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/photo_gallery + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/pub-sub.yml b/.github/workflows/pub-sub.yml index 2d471f1d90..be40dc2817 100644 --- a/.github/workflows/pub-sub.yml +++ b/.github/workflows/pub-sub.yml @@ -7,6 +7,7 @@ on: paths: - motoko/pub-sub/** - .github/workflows/pub-sub.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: motoko-pub-sub: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/pub-sub - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/pub-sub + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/qrcode.yml b/.github/workflows/qrcode.yml index a4f0a0c711..ba108f4a07 100644 --- a/.github/workflows/qrcode.yml +++ b/.github/workflows/qrcode.yml @@ -8,6 +8,7 @@ on: paths: - rust/qrcode/** - .github/workflows/qrcode.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,15 +16,11 @@ concurrency: jobs: rust-qrcode: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/qrcode - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/qrcode + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/query_stats.yml b/.github/workflows/query_stats.yml index b41a3d21e1..5a4f0c3905 100644 --- a/.github/workflows/query_stats.yml +++ b/.github/workflows/query_stats.yml @@ -8,6 +8,7 @@ on: - motoko/query_stats/** - rust/query_stats/** - .github/workflows/query_stats.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,29 +16,21 @@ concurrency: jobs: motoko-query_stats: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/query_stats - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/query_stats + run: | + icp network start -d + icp deploy + bash test.sh rust-query_stats: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/query_stats - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/query_stats + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/random_maze.yml b/.github/workflows/random_maze.yml index ed7e7c854c..2b497b2e55 100644 --- a/.github/workflows/random_maze.yml +++ b/.github/workflows/random_maze.yml @@ -7,6 +7,7 @@ on: paths: - motoko/random_maze/** - .github/workflows/random_maze.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: motoko-random_maze: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/random_maze - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/random_maze + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/react.yml b/.github/workflows/react.yml index c089449a65..820ec50c1b 100644 --- a/.github/workflows/react.yml +++ b/.github/workflows/react.yml @@ -6,19 +6,17 @@ on: paths: - hosting/react/** - .github/workflows/react.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true + jobs: react: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: hosting/react - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: all + working-directory: hosting/react + run: | + icp network start -d + icp deploy diff --git a/.github/workflows/receiving-icp.yml b/.github/workflows/receiving-icp.yml index 08da6c207a..d2fab13325 100644 --- a/.github/workflows/receiving-icp.yml +++ b/.github/workflows/receiving-icp.yml @@ -7,6 +7,7 @@ on: paths: - rust/receiving-icp/** - .github/workflows/receiving-icp.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: rust-receiving_icp: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/receiving-icp - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/receiving-icp + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/send_http_get.yml b/.github/workflows/send_http_get.yml index 682b1b826d..26ba095de2 100644 --- a/.github/workflows/send_http_get.yml +++ b/.github/workflows/send_http_get.yml @@ -8,6 +8,7 @@ on: - motoko/send_http_get/** - rust/send_http_get/** - .github/workflows/send_http_get.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,29 +16,21 @@ concurrency: jobs: motoko-send_http_get: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/send_http_get - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/send_http_get + run: | + icp network start -d + icp deploy + bash test.sh rust-send_http_get: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/send_http_get - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/send_http_get + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/send_http_post.yml b/.github/workflows/send_http_post.yml index e631a40740..476f90fa05 100644 --- a/.github/workflows/send_http_post.yml +++ b/.github/workflows/send_http_post.yml @@ -8,6 +8,7 @@ on: - motoko/send_http_post/** - rust/send_http_post/** - .github/workflows/send_http_post.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,29 +16,21 @@ concurrency: jobs: motoko-send_http_post: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/send_http_post - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/send_http_post + run: | + icp network start -d + icp deploy + bash test.sh rust-send_http_post: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/send_http_post - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/send_http_post + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/simd.yml b/.github/workflows/simd.yml index be430d8a7e..bb112efe1b 100644 --- a/.github/workflows/simd.yml +++ b/.github/workflows/simd.yml @@ -7,6 +7,7 @@ on: paths: - rust/simd/** - .github/workflows/simd.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: rust-simd: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/simd - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/simd + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/stake_neuron_from_cli.yml b/.github/workflows/stake_neuron_from_cli.yml index 241013a14e..6cd267b9d7 100644 --- a/.github/workflows/stake_neuron_from_cli.yml +++ b/.github/workflows/stake_neuron_from_cli.yml @@ -7,6 +7,7 @@ on: paths: - rust/stake_neuron_from_cli/** - .github/workflows/stake_neuron_from_cli.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,14 +15,10 @@ concurrency: jobs: rust-stake_neuron_from_cli: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Build and test - working-directory: rust/stake_neuron_from_cli - run: | - icp network start -d - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/stake_neuron_from_cli + run: | + icp network start -d + bash test.sh diff --git a/.github/workflows/superheroes.yml b/.github/workflows/superheroes.yml index 7a48c67ef7..fbb0819901 100644 --- a/.github/workflows/superheroes.yml +++ b/.github/workflows/superheroes.yml @@ -7,6 +7,7 @@ on: paths: - motoko/superheroes/** - .github/workflows/superheroes.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: motoko-superheroes: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/superheroes - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/superheroes + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/threshold-ecdsa.yml b/.github/workflows/threshold-ecdsa.yml index 9d50ba7ecd..58e39a7a3e 100644 --- a/.github/workflows/threshold-ecdsa.yml +++ b/.github/workflows/threshold-ecdsa.yml @@ -8,6 +8,7 @@ on: - motoko/threshold-ecdsa/** - rust/threshold-ecdsa/** - .github/workflows/threshold-ecdsa.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,29 +16,21 @@ concurrency: jobs: motoko-threshold-ecdsa: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/threshold-ecdsa - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/threshold-ecdsa + run: | + icp network start -d + icp deploy + bash test.sh rust-threshold-ecdsa: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/threshold-ecdsa - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/threshold-ecdsa + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/threshold-schnorr.yml b/.github/workflows/threshold-schnorr.yml index 2eaa707573..5f3af8d1aa 100644 --- a/.github/workflows/threshold-schnorr.yml +++ b/.github/workflows/threshold-schnorr.yml @@ -8,6 +8,7 @@ on: - motoko/threshold-schnorr/** - rust/threshold-schnorr/** - .github/workflows/threshold-schnorr.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,41 +16,25 @@ concurrency: jobs: motoko-threshold-schnorr: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/threshold-schnorr - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/threshold-schnorr + run: | + icp network start -d + icp deploy + bash test.sh rust-threshold-schnorr: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Install clang - run: apt-get update && apt-get install -y --no-install-recommends clang - - name: Build WASM - working-directory: rust/threshold-schnorr - run: icp build backend - - name: Install PocketIC server - uses: dfinity/pocketic@a980c334fab1b21b0b8a6bba38e1a10836e7258b # main - with: - pocket-ic-server-version: "15.0.0" - - name: Run PocketIC integration tests - working-directory: rust/threshold-schnorr - run: cargo test --package backend --test integration_tests - - name: Deploy and test - working-directory: rust/threshold-schnorr - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/threshold-schnorr + run: | + apt-get update && apt-get install -y --no-install-recommends clang + icp build backend + cargo test --package backend --test integration_tests + icp network start -d + icp deploy + bash test.sh + install-pocketic: true diff --git a/.github/workflows/unit_testable_rust_canister.yml b/.github/workflows/unit_testable_rust_canister.yml index 767acb0694..8d7c28bf81 100644 --- a/.github/workflows/unit_testable_rust_canister.yml +++ b/.github/workflows/unit_testable_rust_canister.yml @@ -7,6 +7,7 @@ on: paths: - rust/unit_testable_rust_canister/** - .github/workflows/unit_testable_rust_canister.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,27 +15,15 @@ concurrency: jobs: rust-unit_testable_rust_canister: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Unit tests - working-directory: rust/unit_testable_rust_canister - run: cargo test --package backend --lib - - name: Install PocketIC server - uses: dfinity/pocketic@a980c334fab1b21b0b8a6bba38e1a10836e7258b # main - with: - pocket-ic-server-version: "15.0.0" - - name: Build WASM and run PocketIC integration tests - working-directory: rust/unit_testable_rust_canister - run: | - cargo build --package backend --target wasm32-unknown-unknown --release - cargo test --package backend --test integration_tests - - name: Deploy and test - working-directory: rust/unit_testable_rust_canister - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/unit_testable_rust_canister + run: | + cargo test --package backend --lib + cargo build --package backend --target wasm32-unknown-unknown --release + cargo test --package backend --test integration_tests + icp network start -d + icp deploy + bash test.sh + install-pocketic: true diff --git a/.github/workflows/unity_ii_deeplink.yml b/.github/workflows/unity_ii_deeplink.yml index f0641c6858..35372e3f72 100644 --- a/.github/workflows/unity_ii_deeplink.yml +++ b/.github/workflows/unity_ii_deeplink.yml @@ -7,6 +7,7 @@ on: paths: - native-apps/unity_ii_deeplink/** - .github/workflows/unity_ii_deeplink.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,15 +15,11 @@ concurrency: jobs: native-apps-unity_ii_deeplink: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: native-apps/unity_ii_deeplink - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: native-apps/unity_ii_deeplink + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/vetkeys-basic-bls-signing.yml b/.github/workflows/vetkeys-basic-bls-signing.yml index 15f812e6ce..af8cdd65ec 100644 --- a/.github/workflows/vetkeys-basic-bls-signing.yml +++ b/.github/workflows/vetkeys-basic-bls-signing.yml @@ -9,6 +9,7 @@ on: - motoko/vetkeys/basic_bls_signing/** - rust/vetkeys/basic_bls_signing/** - .github/workflows/vetkeys-basic-bls-signing.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -16,27 +17,19 @@ concurrency: jobs: motoko: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: motoko/vetkeys/basic_bls_signing - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/vetkeys/basic_bls_signing + run: | + icp network start -d + icp deploy rust: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: rust/vetkeys/basic_bls_signing - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/vetkeys/basic_bls_signing + run: | + icp network start -d + icp deploy diff --git a/.github/workflows/vetkeys-basic-ibe.yml b/.github/workflows/vetkeys-basic-ibe.yml index 6f93a75815..277be89213 100644 --- a/.github/workflows/vetkeys-basic-ibe.yml +++ b/.github/workflows/vetkeys-basic-ibe.yml @@ -9,6 +9,7 @@ on: - motoko/vetkeys/basic_ibe/** - rust/vetkeys/basic_ibe/** - .github/workflows/vetkeys-basic-ibe.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -16,27 +17,19 @@ concurrency: jobs: motoko: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: motoko/vetkeys/basic_ibe - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/vetkeys/basic_ibe + run: | + icp network start -d + icp deploy rust: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: rust/vetkeys/basic_ibe - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/vetkeys/basic_ibe + run: | + icp network start -d + icp deploy diff --git a/.github/workflows/vetkeys-basic-timelock-ibe.yml b/.github/workflows/vetkeys-basic-timelock-ibe.yml index 3c610aca36..7b716953cf 100644 --- a/.github/workflows/vetkeys-basic-timelock-ibe.yml +++ b/.github/workflows/vetkeys-basic-timelock-ibe.yml @@ -8,6 +8,7 @@ on: paths: - rust/vetkeys/basic_timelock_ibe/** - .github/workflows/vetkeys-basic-timelock-ibe.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,12 +16,9 @@ concurrency: jobs: rust: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy Basic Timelock Ibe Rust - working-directory: rust/vetkeys/basic_timelock_ibe - run: icp network start -d && icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/vetkeys/basic_timelock_ibe + run: | + icp network start -d && icp deploy diff --git a/.github/workflows/vetkeys-basic-vetkd.yml b/.github/workflows/vetkeys-basic-vetkd.yml index 67d60034c8..653b19808c 100644 --- a/.github/workflows/vetkeys-basic-vetkd.yml +++ b/.github/workflows/vetkeys-basic-vetkd.yml @@ -9,6 +9,7 @@ on: - motoko/vetkeys/basic_vetkd/** - rust/vetkeys/basic_vetkd/** - .github/workflows/vetkeys-basic-vetkd.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -16,29 +17,21 @@ concurrency: jobs: motoko: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/vetkeys/basic_vetkd - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/vetkeys/basic_vetkd + run: | + icp network start -d + icp deploy + bash test.sh rust: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/vetkeys/basic_vetkd - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/vetkeys/basic_vetkd + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/vetkeys-encrypted-notes-app-vetkd.yml b/.github/workflows/vetkeys-encrypted-notes-app-vetkd.yml index 15035bc8fd..d2df165b50 100644 --- a/.github/workflows/vetkeys-encrypted-notes-app-vetkd.yml +++ b/.github/workflows/vetkeys-encrypted-notes-app-vetkd.yml @@ -9,6 +9,7 @@ on: - motoko/vetkeys/encrypted_notes_app_vetkd/** - rust/vetkeys/encrypted_notes_app_vetkd/** - .github/workflows/vetkeys-encrypted-notes-app-vetkd.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -16,27 +17,19 @@ concurrency: jobs: motoko: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: motoko/vetkeys/encrypted_notes_app_vetkd - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/vetkeys/encrypted_notes_app_vetkd + run: | + icp network start -d + icp deploy rust: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: rust/vetkeys/encrypted_notes_app_vetkd - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/vetkeys/encrypted_notes_app_vetkd + run: | + icp network start -d + icp deploy diff --git a/.github/workflows/vetkeys-password-manager-with-metadata.yml b/.github/workflows/vetkeys-password-manager-with-metadata.yml index 79beb304da..dcd18af70b 100644 --- a/.github/workflows/vetkeys-password-manager-with-metadata.yml +++ b/.github/workflows/vetkeys-password-manager-with-metadata.yml @@ -8,6 +8,7 @@ on: paths: - rust/vetkeys/password_manager_with_metadata/** - .github/workflows/vetkeys-password-manager-with-metadata.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,22 +16,17 @@ concurrency: jobs: rust: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy Password Manager With Metadata Rust - working-directory: rust/vetkeys/password_manager_with_metadata/rust - run: icp network start -d && icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/vetkeys/password_manager_with_metadata/rust + run: | + icp network start -d && icp deploy + motoko: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy Password Manager With Metadata Motoko - working-directory: rust/vetkeys/password_manager_with_metadata/motoko - run: icp network start -d && icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: rust/vetkeys/password_manager_with_metadata/motoko + run: | + icp network start -d && icp deploy diff --git a/.github/workflows/vetkeys-password-manager.yml b/.github/workflows/vetkeys-password-manager.yml index 3d16895f6a..63c184d068 100644 --- a/.github/workflows/vetkeys-password-manager.yml +++ b/.github/workflows/vetkeys-password-manager.yml @@ -9,6 +9,7 @@ on: - motoko/vetkeys/password_manager/** - rust/vetkeys/password_manager/** - .github/workflows/vetkeys-password-manager.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -16,27 +17,19 @@ concurrency: jobs: motoko: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: motoko/vetkeys/password_manager - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/vetkeys/password_manager + run: | + icp network start -d + icp deploy rust: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy - working-directory: rust/vetkeys/password_manager - run: | - icp network start -d - icp deploy + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/vetkeys/password_manager + run: | + icp network start -d + icp deploy diff --git a/.github/workflows/wasm_counter.yml b/.github/workflows/wasm_counter.yml index abd7e134e9..13202882d1 100644 --- a/.github/workflows/wasm_counter.yml +++ b/.github/workflows/wasm_counter.yml @@ -7,6 +7,7 @@ on: paths: - wasm/counter/** - .github/workflows/wasm_counter.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,17 +15,12 @@ concurrency: jobs: wasm-counter: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-all:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Install wabt - run: apt-get update && apt-get install -y wabt - - name: Deploy and test - working-directory: wasm/counter - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: all + working-directory: wasm/counter + run: | + apt-get update && apt-get install -y wabt + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/who_am_i.yml b/.github/workflows/who_am_i.yml index c157d5cd07..d6078d8a46 100644 --- a/.github/workflows/who_am_i.yml +++ b/.github/workflows/who_am_i.yml @@ -9,6 +9,7 @@ on: - motoko/who_am_i/** - rust/who_am_i/** - .github/workflows/who_am_i.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -16,29 +17,21 @@ concurrency: jobs: motoko-who_am_i: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-motoko:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: motoko/who_am_i - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: motoko + working-directory: motoko/who_am_i + run: | + icp network start -d + icp deploy + bash test.sh rust-who_am_i: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Deploy and test - working-directory: rust/who_am_i - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/who_am_i + run: | + icp network start -d + icp deploy + bash test.sh diff --git a/.github/workflows/x509.yml b/.github/workflows/x509.yml index ab9b188dcf..4b537e4563 100644 --- a/.github/workflows/x509.yml +++ b/.github/workflows/x509.yml @@ -7,6 +7,7 @@ on: paths: - rust/x509/** - .github/workflows/x509.yml + - .github/workflows/_run-example.yml concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,26 +15,15 @@ concurrency: jobs: rust-x509: - runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-rust:1.0.1 - env: - ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: Install dependencies - run: apt-get update && apt-get install -y --no-install-recommends libssl-dev pkg-config - - name: Install PocketIC server - uses: dfinity/pocketic@a980c334fab1b21b0b8a6bba38e1a10836e7258b # main - with: - pocket-ic-server-version: "15.0.0" - - name: Build WASM and run PocketIC integration tests - working-directory: rust/x509 - run: | - icp build backend - cargo test --package backend --test integration_tests - - name: Deploy and test - working-directory: rust/x509 - run: | - icp network start -d - icp deploy - bash test.sh + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/x509 + run: | + apt-get update && apt-get install -y --no-install-recommends libssl-dev pkg-config + icp build backend + cargo test --package backend --test integration_tests + icp network start -d + icp deploy + bash test.sh + install-pocketic: true From 315dbbb9e385e05b956e3e746263b4ef55b5b41c Mon Sep 17 00:00:00 2001 From: Marco Walz Date: Wed, 22 Jul 2026 15:53:28 +0200 Subject: [PATCH 3/4] ci: address review feedback on the dev-env centralization - workflow-template.yml: show the two-language (Motoko + Rust) form by default with one pull_request path entry per language, and document the single-language, frontend-only, and PocketIC variants. The previous single placeholder would have under-triggered a copied two-language workflow. - dev-env-version-check.yml: anchor the version grep to the actual `container: ghcr.io/dfinity/icp-dev-env` line (first match) so a comment or example line can't be picked up by mistake. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflow-template.yml | 36 ++++++++++++++------- .github/workflows/dev-env-version-check.yml | 2 +- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflow-template.yml b/.github/workflow-template.yml index cd7938621b..181ea4a485 100644 --- a/.github/workflow-template.yml +++ b/.github/workflow-template.yml @@ -1,17 +1,18 @@ # Workflow template for ICP examples. -# Copy this file to .github/workflows/.yml and replace the placeholders. +# Copy this file to .github/workflows/.yml and replace . # # Examples run inside the ICP dev-env container via the reusable _run-example.yml # workflow, which is the single source of truth for the dev-env image version. # -# PLACEHOLDERS: -# e.g. hello_world -# motoko | rust | all (use "all" for frontend-only examples) -# e.g. motoko/hello_world (for frontend-only: hosting/) +# This template shows a two-language example (Motoko + Rust). Adjust it: +# - Single-language example: keep only the relevant job and its path entry. +# - Frontend-only example: use one job with `language: all` and a +# `hosting//**` path + `working-directory: hosting/`. +# - Integration tests needing PocketIC: add `install-pocketic: true` to the job +# (and optionally `pocketic-version`). # -# For a two-language example, add one job per language (e.g. motoko- -# and rust-). Examples that need a PocketIC server for integration -# tests can set `install-pocketic: true` (and optionally `pocketic-version`). +# Keep one pull_request path entry per language directory the example ships, so a +# change in any of them triggers this workflow. name: @@ -21,7 +22,8 @@ on: - master pull_request: paths: - - /** + - motoko//** + - rust//** - .github/workflows/.yml - .github/workflows/_run-example.yml @@ -30,11 +32,21 @@ concurrency: cancel-in-progress: true jobs: - -: + motoko-: uses: ./.github/workflows/_run-example.yml with: - language: - working-directory: + language: motoko + working-directory: motoko/ + run: | + icp network start -d + icp deploy + bash test.sh + + rust-: + uses: ./.github/workflows/_run-example.yml + with: + language: rust + working-directory: rust/ run: | icp network start -d icp deploy diff --git a/.github/workflows/dev-env-version-check.yml b/.github/workflows/dev-env-version-check.yml index 7c148b70ee..ba51c769de 100644 --- a/.github/workflows/dev-env-version-check.yml +++ b/.github/workflows/dev-env-version-check.yml @@ -22,7 +22,7 @@ jobs: - name: Compare dev-env image versions run: | devcontainer_version=$(jq -r '.image' .devcontainer/devcontainer.json | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') - ci_version=$(grep -E 'container:.*icp-dev-env' .github/workflows/_run-example.yml | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) + ci_version=$(grep -m1 -E '^[[:space:]]*container:[[:space:]]*ghcr\.io/dfinity/icp-dev-env' .github/workflows/_run-example.yml | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') echo "devcontainer.json: ${devcontainer_version:-}" echo "_run-example.yml: ${ci_version:-}" if [ -z "$devcontainer_version" ] || [ -z "$ci_version" ]; then From 4d7bb483027c7a0d412d2a728e87c14ad3b5ab48 Mon Sep 17 00:00:00 2001 From: Marco Walz Date: Fri, 24 Jul 2026 00:00:33 +0200 Subject: [PATCH 4/4] ci: bump dev-env image to v1.2.0 Bump the pinned icp-dev-env image from 1.1.0 to the v-prefixed v1.2.0 tag in the two source-of-truth locations, and document the v-prefix convention in AGENTS.md. The registry publishes both `v1.2.0` and `1.2.0` tags (from type=ref,event=tag and type=semver respectively); we pin the v-prefixed form. dev-env-version-check.yml keeps devcontainer.json and _run-example.yml in sync. Awaiting dfinity/icp-dev-env#43 (the v1.2.0 release); CI will be red until that image is published. Co-Authored-By: Claude Opus 4.8 (1M context) --- .devcontainer/devcontainer.json | 2 +- .github/workflows/_run-example.yml | 2 +- AGENTS.md | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a80ccc8c22..306512c0c3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { "name": "ICP Examples (Motoko + Rust)", - "image": "ghcr.io/dfinity/icp-dev-env-all:1.1.0", + "image": "ghcr.io/dfinity/icp-dev-env-all:v1.2.0", "forwardPorts": [8000, 5173], "portsAttributes": { "8000": { diff --git a/.github/workflows/_run-example.yml b/.github/workflows/_run-example.yml index 6c1e93b114..5a9ffeebb0 100644 --- a/.github/workflows/_run-example.yml +++ b/.github/workflows/_run-example.yml @@ -50,7 +50,7 @@ on: jobs: run: runs-on: ubuntu-24.04 - container: ghcr.io/dfinity/icp-dev-env-${{ inputs.language }}:1.1.0 + container: ghcr.io/dfinity/icp-dev-env-${{ inputs.language }}:v1.2.0 env: ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: diff --git a/AGENTS.md b/AGENTS.md index 91555d34a0..536ce30c45 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -491,9 +491,11 @@ Rust: `icp build backend && candid-extractor target/wasm32-unknown-unknown/relea ## Pending items (do not resolve prematurely) ### Container images -Images are published at `ghcr.io/dfinity/icp-dev-env-{motoko,rust,all}`. Current pinned version: **`1.0.1`**. All devcontainer configs and CI workflows reference the pinned tag. When a new release is cut, update the tag in: +Images are published at `ghcr.io/dfinity/icp-dev-env-{motoko,rust,all}`. Current pinned version: **`v1.2.0`**. Releases are tagged with a `v` prefix (e.g. `v1.2.0`); the registry publishes both `v1.2.0` and `1.2.0` tags, and we pin the `v`-prefixed form. When a new release is cut, update the tag in: - `.devcontainer/devcontainer.json` -- `.github/workflows/*.yml` +- `.github/workflows/_run-example.yml` (the single source of truth for the CI image version) + +`dev-env-version-check.yml` guards that these two stay in sync. Source: https://github.com/dfinity/icp-dev-env