From 949f2f8f24d125a5bd90ea586131cd5c6de71b30 Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Thu, 8 Jan 2026 12:12:22 +0300 Subject: [PATCH] fix: getting-started workflow use local templates and workspace builds - Add PEZKUWI_TEMPLATE_SOURCE env var support to getting-started.sh for using local templates instead of cloning from external repos - Update workflow to build templates within SDK workspace context since templates use workspace inheritance - Add package names to matrix for correct cargo -p targets - Add SKIP_WASM_BUILD=1 to avoid serde_core wasm32 issues --- .github/workflows/check-getting-started.yml | 41 ++++++++++++++++----- scripts/getting-started.sh | 11 +++++- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check-getting-started.yml b/.github/workflows/check-getting-started.yml index 2a95eaa9..e29cc302 100644 --- a/.github/workflows/check-getting-started.yml +++ b/.github/workflows/check-getting-started.yml @@ -46,25 +46,35 @@ jobs: - name: ubuntu container: ubuntu template: minimal + package: pez-minimal-template-node shell: bash - name: debian container: debian template: teyrchain + package: teyrchain-template-node shell: sh - name: arch container: archlinux template: solochain + package: pez-solochain-template-node shell: sh - name: fedora container: fedora template: teyrchain + package: teyrchain-template-node shell: sh - name: opensuse container: opensuse/tumbleweed template: solochain + package: pez-solochain-template-node shell: sh runs-on: ubuntu-latest container: ${{ matrix.container }}:latest + env: + # Use local templates from the repo instead of cloning from external repos + PEZKUWI_TEMPLATE_SOURCE: ${{ github.workspace }}/templates + # Skip WASM build due to serde_core compatibility issues + SKIP_WASM_BUILD: 1 steps: # A minimal amount of prerequisites required before we can run the actual getting-started script, # which will install the rest of requirements. @@ -167,18 +177,20 @@ jobs: ' timeout-minutes: 15 - - name: Compile the node outside of the script + # Build the template from within the SDK workspace context + # Templates use workspace inheritance and can't be built standalone + - name: Compile the template node run: | . "$HOME/.cargo/env" - cd ${{ matrix.template }}-template - cargo build --release + cd ${{ github.workspace }} + cargo build --release -p ${{ matrix.package }} timeout-minutes: 120 - name: Check that the binary is executable run: | . "$HOME/.cargo/env" - cd ${{ matrix.template }}-template - cargo run --release -- --help + cd ${{ github.workspace }} + cargo run --release -p ${{ matrix.package }} -- --help timeout-minutes: 5 check-getting-started-macos: @@ -188,10 +200,17 @@ jobs: matrix: include: - template: teyrchain + package: teyrchain-template-node shell: sh - template: solochain + package: pez-solochain-template-node shell: bash runs-on: macos-latest + env: + # Use local templates from the repo instead of cloning from external repos + PEZKUWI_TEMPLATE_SOURCE: ${{ github.workspace }}/templates + # Skip WASM build due to serde_core compatibility issues + SKIP_WASM_BUILD: 1 steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 @@ -285,16 +304,18 @@ jobs: ' timeout-minutes: 15 - - name: Compile the node outside of the script + # Build the template from within the SDK workspace context + # Templates use workspace inheritance and can't be built standalone + - name: Compile the template node run: | . "$HOME/.cargo/env" - cd ${{ matrix.template }}-template - cargo build --release + cd ${{ github.workspace }} + cargo build --release -p ${{ matrix.package }} timeout-minutes: 120 - name: Check that the binary is executable run: | . "$HOME/.cargo/env" - cd ${{ matrix.template }}-template - cargo run --release -- --help + cd ${{ github.workspace }} + cargo run --release -p ${{ matrix.package }} -- --help timeout-minutes: 5 diff --git a/scripts/getting-started.sh b/scripts/getting-started.sh index 04ec3b3b..adb6670f 100755 --- a/scripts/getting-started.sh +++ b/scripts/getting-started.sh @@ -33,8 +33,15 @@ clone_and_enter_template() { if [ -d "${template}-template" ]; then printf "\n✅︎ ${template}-template directory already exists. -> Entering.\n" else - printf "\n↓ Let's grab the ${template} template from github.\n" - git clone --quiet https://github.com/pezkuwichain/pezkuwi-sdk-${template}-template.git ${template}-template + # PEZKUWI_TEMPLATE_SOURCE can be set to a local path for CI testing + # e.g., PEZKUWI_TEMPLATE_SOURCE="/path/to/pezkuwi-sdk/templates" + if [ -n "$PEZKUWI_TEMPLATE_SOURCE" ] && [ -d "$PEZKUWI_TEMPLATE_SOURCE/${template}" ]; then + printf "\n↓ Copying ${template} template from local source.\n" + cp -r "$PEZKUWI_TEMPLATE_SOURCE/${template}" "${template}-template" + else + printf "\n↓ Let's grab the ${template} template from github.\n" + git clone --quiet https://github.com/pezkuwichain/pezkuwi-sdk-${template}-template.git ${template}-template + fi fi cd ${template}-template }