From 92f25c615a3667013deef4ee1f39cc7164a3a538 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 08:00:05 +0000 Subject: [PATCH 1/9] Add ngrok devcontainer feature with amd64 and arm64 support Agent-Logs-Url: https://github.com/tokidoki11/devcontainer-feature/sessions/f2bd6af8-987d-45c6-956f-71706b53a0dd Co-authored-by: tokidoki11 <7564844+tokidoki11@users.noreply.github.com> --- src/ngrok/README.md | 33 +++++++++++++++++ src/ngrok/devcontainer-feature.json | 13 +++++++ src/ngrok/install.sh | 57 +++++++++++++++++++++++++++++ test/ngrok/scenarios.json | 8 ++++ test/ngrok/test.sh | 12 ++++++ 5 files changed, 123 insertions(+) create mode 100644 src/ngrok/README.md create mode 100644 src/ngrok/devcontainer-feature.json create mode 100755 src/ngrok/install.sh create mode 100644 test/ngrok/scenarios.json create mode 100755 test/ngrok/test.sh diff --git a/src/ngrok/README.md b/src/ngrok/README.md new file mode 100644 index 0000000..bfcdc5a --- /dev/null +++ b/src/ngrok/README.md @@ -0,0 +1,33 @@ +# ngrok + +Installs [ngrok](https://ngrok.com/), a secure tunnel to localhost. Supports both `amd64` and `arm64` architectures. + +## Options + +| Options Id | Description | Type | Default Value | +|-----|-----|-----|-----| +| version | Version of ngrok to install (e.g. `latest`, `stable`, or a specific version like `3.5.0`) | string | latest | + +## Usage + +Add to your `devcontainer.json`: + +```jsonc +{ + "features": { + "ghcr.io/tokidoki11/devcontainer-feature/ngrok:1": {} + } +} +``` + +To install a specific version: + +```jsonc +{ + "features": { + "ghcr.io/tokidoki11/devcontainer-feature/ngrok:1": { + "version": "3.5.0" + } + } +} +``` diff --git a/src/ngrok/devcontainer-feature.json b/src/ngrok/devcontainer-feature.json new file mode 100644 index 0000000..39915bb --- /dev/null +++ b/src/ngrok/devcontainer-feature.json @@ -0,0 +1,13 @@ +{ + "name": "ngrok", + "id": "ngrok", + "version": "1.0.0", + "description": "Install ngrok - a secure tunnel to localhost. Supports amd64 and arm64 architectures.", + "options": { + "version": { + "type": "string", + "default": "latest", + "description": "Version of ngrok to install (e.g. 'latest', 'stable', or a specific version like '3.5.0')" + } + } +} diff --git a/src/ngrok/install.sh b/src/ngrok/install.sh new file mode 100755 index 0000000..a49eab5 --- /dev/null +++ b/src/ngrok/install.sh @@ -0,0 +1,57 @@ +#!/bin/bash +set -e + +NGROK_VERSION="${VERSION:-"latest"}" + +# Detect architecture +ARCH=$(uname -m) +case "$ARCH" in + x86_64) NGROK_ARCH="amd64" ;; + aarch64 | arm64) NGROK_ARCH="arm64" ;; + *) echo "Unsupported architecture: $ARCH"; exit 1 ;; +esac + +# Map "latest" to "stable" for the equinox download URL +if [ "$NGROK_VERSION" = "latest" ]; then + NGROK_VERSION="stable" +fi + +# The equinox.io URL path 'bNyj1mQVY4c' is ngrok's stable channel identifier for v3. +# Supported values for NGROK_VERSION: 'stable', or specific versions like '3.5.0'. +DOWNLOAD_URL="https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-${NGROK_VERSION}-linux-${NGROK_ARCH}.tgz" + +# Checks if packages are installed and installs them if not +check_packages() { + if ! dpkg -s "$@" > /dev/null 2>&1; then + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update -y + fi + apt-get -y install --no-install-recommends "$@" + fi +} + +export DEBIAN_FRONTEND=noninteractive + +check_packages curl ca-certificates + +echo "Downloading ngrok ${NGROK_VERSION} for ${NGROK_ARCH} from ${DOWNLOAD_URL}" + +TEMP_DIR=$(mktemp -d) +if ! curl -sSL --fail "${DOWNLOAD_URL}" -o "${TEMP_DIR}/ngrok.tgz"; then + echo "ERROR: Failed to download ngrok. Please verify the version '${NGROK_VERSION}' is valid and the URL is reachable: ${DOWNLOAD_URL}" + rm -rf "${TEMP_DIR}" + exit 1 +fi +if ! tar -xzf "${TEMP_DIR}/ngrok.tgz" -C "${TEMP_DIR}"; then + echo "ERROR: Failed to extract ngrok archive. The downloaded file may be corrupted." + rm -rf "${TEMP_DIR}" + exit 1 +fi +install -m 0755 "${TEMP_DIR}/ngrok" /usr/local/bin/ngrok + +rm -rf "${TEMP_DIR}" +rm -rf /var/lib/apt/lists/* + +echo "ngrok installed successfully" +ngrok version diff --git a/test/ngrok/scenarios.json b/test/ngrok/scenarios.json new file mode 100644 index 0000000..6e908c0 --- /dev/null +++ b/test/ngrok/scenarios.json @@ -0,0 +1,8 @@ +{ + "install_latest": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ngrok": {} + } + } +} diff --git a/test/ngrok/test.sh b/test/ngrok/test.sh new file mode 100755 index 0000000..53124ce --- /dev/null +++ b/test/ngrok/test.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +source dev-container-features-test-lib + +# Feature-specific tests +check "ngrok installed" bash -c "ngrok version" +check "ngrok is executable" which ngrok + +# Report results +reportResults From c2594762b65feea4f8fd570f2117f997206c49ea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 08:28:13 +0000 Subject: [PATCH 2/9] Add ngrok to CI test matrix in GitHub Actions workflow Agent-Logs-Url: https://github.com/tokidoki11/devcontainer-feature/sessions/afc37722-61dd-4f13-a843-238fb1973566 Co-authored-by: tokidoki11 <7564844+tokidoki11@users.noreply.github.com> --- .github/workflows/test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fa62b5b..168b8b2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,6 +15,7 @@ jobs: features: - cargo-lambda - lambroll + - ngrok baseImage: - debian:latest - ubuntu:latest @@ -35,6 +36,7 @@ jobs: features: - cargo-lambda - lambroll + - ngrok steps: - uses: actions/checkout@v4 From 2780cec1adc5f82e615abd77127e4748cfb52fc3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 08:34:12 +0000 Subject: [PATCH 3/9] Add install_latest.sh scenario test script for ngrok feature Agent-Logs-Url: https://github.com/tokidoki11/devcontainer-feature/sessions/055bcfd5-a8ac-4c76-a69a-56fb8ef53558 Co-authored-by: tokidoki11 <7564844+tokidoki11@users.noreply.github.com> --- test/ngrok/install_latest.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 test/ngrok/install_latest.sh diff --git a/test/ngrok/install_latest.sh b/test/ngrok/install_latest.sh new file mode 100755 index 0000000..53124ce --- /dev/null +++ b/test/ngrok/install_latest.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +source dev-container-features-test-lib + +# Feature-specific tests +check "ngrok installed" bash -c "ngrok version" +check "ngrok is executable" which ngrok + +# Report results +reportResults From 5df5e5d24b321acea0f47ea368ad496000ba5190 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 08:43:53 +0000 Subject: [PATCH 4/9] Add path-based change detection to CI workflow using dorny/paths-filter Agent-Logs-Url: https://github.com/tokidoki11/devcontainer-feature/sessions/86ad65f1-c431-453e-ab95-f647fa7aef96 Co-authored-by: tokidoki11 <7564844+tokidoki11@users.noreply.github.com> --- .github/workflows/test.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 168b8b2..d12c269 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,7 +7,31 @@ on: workflow_dispatch: jobs: + changes: + runs-on: ubuntu-latest + outputs: + cargo-lambda: ${{ steps.filter.outputs.cargo-lambda }} + lambroll: ${{ steps.filter.outputs.lambroll }} + ngrok: ${{ steps.filter.outputs.ngrok }} + steps: + - uses: actions/checkout@v4 + + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + cargo-lambda: + - 'src/cargo-lambda/**' + - 'test/cargo-lambda/**' + lambroll: + - 'src/lambroll/**' + - 'test/lambroll/**' + ngrok: + - 'src/ngrok/**' + - 'test/ngrok/**' + test-autogenerated: + needs: changes runs-on: ubuntu-latest continue-on-error: true strategy: @@ -19,6 +43,11 @@ jobs: baseImage: - debian:latest - ubuntu:latest + if: | + github.event_name == 'workflow_dispatch' || + (matrix.features == 'cargo-lambda' && needs.changes.outputs.cargo-lambda == 'true') || + (matrix.features == 'lambroll' && needs.changes.outputs.lambroll == 'true') || + (matrix.features == 'ngrok' && needs.changes.outputs.ngrok == 'true') steps: - uses: actions/checkout@v4 @@ -29,6 +58,7 @@ jobs: run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} . test-scenarios: + needs: changes runs-on: ubuntu-latest continue-on-error: true strategy: @@ -37,6 +67,11 @@ jobs: - cargo-lambda - lambroll - ngrok + if: | + github.event_name == 'workflow_dispatch' || + (matrix.features == 'cargo-lambda' && needs.changes.outputs.cargo-lambda == 'true') || + (matrix.features == 'lambroll' && needs.changes.outputs.lambroll == 'true') || + (matrix.features == 'ngrok' && needs.changes.outputs.ngrok == 'true') steps: - uses: actions/checkout@v4 From 95e235b5e611f86734b00c540e2b8524e0b1bfd1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 08:44:39 +0000 Subject: [PATCH 5/9] Add explicit permissions block to CI workflow (contents: read) Agent-Logs-Url: https://github.com/tokidoki11/devcontainer-feature/sessions/86ad65f1-c431-453e-ab95-f647fa7aef96 Co-authored-by: tokidoki11 <7564844+tokidoki11@users.noreply.github.com> --- .github/workflows/test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d12c269..8711d5f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,6 +6,9 @@ on: pull_request: workflow_dispatch: +permissions: + contents: read + jobs: changes: runs-on: ubuntu-latest From 46af616a68a293683f76918affe708389817e6b2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 09:00:15 +0000 Subject: [PATCH 6/9] Fix invalid workflow: split feature matrix into per-feature jobs for valid if conditions Agent-Logs-Url: https://github.com/tokidoki11/devcontainer-feature/sessions/3f7a0c2b-a1f8-4fb8-b79e-36c1de785a96 Co-authored-by: tokidoki11 <7564844+tokidoki11@users.noreply.github.com> --- .github/workflows/test.yaml | 96 +++++++++++++++++++++++++++---------- 1 file changed, 72 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8711d5f..ef656bc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -33,56 +33,104 @@ jobs: - 'src/ngrok/**' - 'test/ngrok/**' - test-autogenerated: + test-autogenerated-cargo-lambda: needs: changes + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.cargo-lambda == 'true' runs-on: ubuntu-latest continue-on-error: true strategy: matrix: - features: - - cargo-lambda - - lambroll - - ngrok baseImage: - debian:latest - ubuntu:latest - if: | - github.event_name == 'workflow_dispatch' || - (matrix.features == 'cargo-lambda' && needs.changes.outputs.cargo-lambda == 'true') || - (matrix.features == 'lambroll' && needs.changes.outputs.lambroll == 'true') || - (matrix.features == 'ngrok' && needs.changes.outputs.ngrok == 'true') steps: - uses: actions/checkout@v4 - name: "Install latest devcontainer CLI" run: npm install -g @devcontainers/cli - - name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'" - run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} . + - name: "Generating tests for 'cargo-lambda' against '${{ matrix.baseImage }}'" + run: devcontainer features test --skip-scenarios -f cargo-lambda -i ${{ matrix.baseImage }} . - test-scenarios: + test-autogenerated-lambroll: needs: changes + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.lambroll == 'true' runs-on: ubuntu-latest continue-on-error: true strategy: matrix: - features: - - cargo-lambda - - lambroll - - ngrok - if: | - github.event_name == 'workflow_dispatch' || - (matrix.features == 'cargo-lambda' && needs.changes.outputs.cargo-lambda == 'true') || - (matrix.features == 'lambroll' && needs.changes.outputs.lambroll == 'true') || - (matrix.features == 'ngrok' && needs.changes.outputs.ngrok == 'true') + baseImage: + - debian:latest + - ubuntu:latest + steps: + - uses: actions/checkout@v4 + + - name: "Install latest devcontainer CLI" + run: npm install -g @devcontainers/cli + + - name: "Generating tests for 'lambroll' against '${{ matrix.baseImage }}'" + run: devcontainer features test --skip-scenarios -f lambroll -i ${{ matrix.baseImage }} . + + test-autogenerated-ngrok: + needs: changes + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.ngrok == 'true' + runs-on: ubuntu-latest + continue-on-error: true + strategy: + matrix: + baseImage: + - debian:latest + - ubuntu:latest + steps: + - uses: actions/checkout@v4 + + - name: "Install latest devcontainer CLI" + run: npm install -g @devcontainers/cli + + - name: "Generating tests for 'ngrok' against '${{ matrix.baseImage }}'" + run: devcontainer features test --skip-scenarios -f ngrok -i ${{ matrix.baseImage }} . + + test-scenarios-cargo-lambda: + needs: changes + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.cargo-lambda == 'true' + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/checkout@v4 + + - name: "Install latest devcontainer CLI" + run: npm install -g @devcontainers/cli + + - name: "Generating tests for 'cargo-lambda' scenarios" + run: devcontainer features test -f cargo-lambda --skip-autogenerated --skip-duplicated . + + test-scenarios-lambroll: + needs: changes + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.lambroll == 'true' + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/checkout@v4 + + - name: "Install latest devcontainer CLI" + run: npm install -g @devcontainers/cli + + - name: "Generating tests for 'lambroll' scenarios" + run: devcontainer features test -f lambroll --skip-autogenerated --skip-duplicated . + + test-scenarios-ngrok: + needs: changes + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.ngrok == 'true' + runs-on: ubuntu-latest + continue-on-error: true steps: - uses: actions/checkout@v4 - name: "Install latest devcontainer CLI" run: npm install -g @devcontainers/cli - - name: "Generating tests for '${{ matrix.features }}' scenarios" - run: devcontainer features test -f ${{ matrix.features }} --skip-autogenerated --skip-duplicated . + - name: "Generating tests for 'ngrok' scenarios" + run: devcontainer features test -f ngrok --skip-autogenerated --skip-duplicated . test-global: runs-on: ubuntu-latest From c4877467094abb2335c19af869cd8c75d2d806ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:10:48 +0000 Subject: [PATCH 7/9] Use dynamic matrix from compute-feature-matrix job; update root README with ngrok Agent-Logs-Url: https://github.com/tokidoki11/devcontainer-feature/sessions/6a022cd3-682d-4dc2-abfc-cdb9d2f4eb6c Co-authored-by: tokidoki11 <7564844+tokidoki11@users.noreply.github.com> --- .github/workflows/test.yaml | 110 +++++++++++------------------------- README.md | 8 ++- 2 files changed, 39 insertions(+), 79 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ef656bc..1cb5dad 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,12 +10,10 @@ permissions: contents: read jobs: - changes: + compute-feature-matrix: runs-on: ubuntu-latest outputs: - cargo-lambda: ${{ steps.filter.outputs.cargo-lambda }} - lambroll: ${{ steps.filter.outputs.lambroll }} - ngrok: ${{ steps.filter.outputs.ngrok }} + features: ${{ steps.compute.outputs.features }} steps: - uses: actions/checkout@v4 @@ -33,13 +31,32 @@ jobs: - 'src/ngrok/**' - 'test/ngrok/**' - test-autogenerated-cargo-lambda: - needs: changes - if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.cargo-lambda == 'true' + - name: "Compute features matrix" + id: compute + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo 'features=["cargo-lambda","lambroll","ngrok"]' >> "$GITHUB_OUTPUT" + else + features=() + [ "${{ steps.filter.outputs.cargo-lambda }}" = "true" ] && features+=("cargo-lambda") + [ "${{ steps.filter.outputs.lambroll }}" = "true" ] && features+=("lambroll") + [ "${{ steps.filter.outputs.ngrok }}" = "true" ] && features+=("ngrok") + if [ ${#features[@]} -eq 0 ]; then + echo 'features=[]' >> "$GITHUB_OUTPUT" + else + json=$(printf '%s\n' "${features[@]}" | jq -R . | jq -sc .) + echo "features=$json" >> "$GITHUB_OUTPUT" + fi + fi + + test-autogenerated: + needs: compute-feature-matrix + if: needs.compute-feature-matrix.outputs.features != '[]' && needs.compute-feature-matrix.outputs.features != '' runs-on: ubuntu-latest continue-on-error: true strategy: matrix: + features: ${{ fromJson(needs.compute-feature-matrix.outputs.features) }} baseImage: - debian:latest - ubuntu:latest @@ -49,88 +66,25 @@ jobs: - name: "Install latest devcontainer CLI" run: npm install -g @devcontainers/cli - - name: "Generating tests for 'cargo-lambda' against '${{ matrix.baseImage }}'" - run: devcontainer features test --skip-scenarios -f cargo-lambda -i ${{ matrix.baseImage }} . + - name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'" + run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} . - test-autogenerated-lambroll: - needs: changes - if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.lambroll == 'true' + test-scenarios: + needs: compute-feature-matrix + if: needs.compute-feature-matrix.outputs.features != '[]' && needs.compute-feature-matrix.outputs.features != '' runs-on: ubuntu-latest continue-on-error: true strategy: matrix: - baseImage: - - debian:latest - - ubuntu:latest - steps: - - uses: actions/checkout@v4 - - - name: "Install latest devcontainer CLI" - run: npm install -g @devcontainers/cli - - - name: "Generating tests for 'lambroll' against '${{ matrix.baseImage }}'" - run: devcontainer features test --skip-scenarios -f lambroll -i ${{ matrix.baseImage }} . - - test-autogenerated-ngrok: - needs: changes - if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.ngrok == 'true' - runs-on: ubuntu-latest - continue-on-error: true - strategy: - matrix: - baseImage: - - debian:latest - - ubuntu:latest - steps: - - uses: actions/checkout@v4 - - - name: "Install latest devcontainer CLI" - run: npm install -g @devcontainers/cli - - - name: "Generating tests for 'ngrok' against '${{ matrix.baseImage }}'" - run: devcontainer features test --skip-scenarios -f ngrok -i ${{ matrix.baseImage }} . - - test-scenarios-cargo-lambda: - needs: changes - if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.cargo-lambda == 'true' - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v4 - - - name: "Install latest devcontainer CLI" - run: npm install -g @devcontainers/cli - - - name: "Generating tests for 'cargo-lambda' scenarios" - run: devcontainer features test -f cargo-lambda --skip-autogenerated --skip-duplicated . - - test-scenarios-lambroll: - needs: changes - if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.lambroll == 'true' - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v4 - - - name: "Install latest devcontainer CLI" - run: npm install -g @devcontainers/cli - - - name: "Generating tests for 'lambroll' scenarios" - run: devcontainer features test -f lambroll --skip-autogenerated --skip-duplicated . - - test-scenarios-ngrok: - needs: changes - if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.ngrok == 'true' - runs-on: ubuntu-latest - continue-on-error: true + features: ${{ fromJson(needs.compute-feature-matrix.outputs.features) }} steps: - uses: actions/checkout@v4 - name: "Install latest devcontainer CLI" run: npm install -g @devcontainers/cli - - name: "Generating tests for 'ngrok' scenarios" - run: devcontainer features test -f ngrok --skip-autogenerated --skip-duplicated . + - name: "Generating tests for '${{ matrix.features }}' scenarios" + run: devcontainer features test -f ${{ matrix.features }} --skip-autogenerated --skip-duplicated . test-global: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 3ecb208..a3682e6 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ > > - [cargo-lambda](https://www.cargo-lambda.info/) > - [lambroll](https://github.com/fujiwara/lambroll) +> - [ngrok](https://ngrok.com/) # How to use @@ -13,4 +14,9 @@ note: - This will install zig to latest version via (ghcr.io/devcontainers-extra/features/zig:1) - `rust` and `binstall` when not available, will be downloaded -Lambroll: [Readme](src/lambroll/README.md) \ No newline at end of file +Lambroll: [Readme](src/lambroll/README.md) + +ngrok: [Readme](src/ngrok/README.md) + +- Supports `amd64` (x86_64) and `arm64` (aarch64) architectures +- Defaults to the latest stable release; a specific version can be pinned via the `version` option \ No newline at end of file From c520aeec6421cbb09e46a2d17c1b114cf5ba25cc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:19:24 +0000 Subject: [PATCH 8/9] Simplify compute-feature-matrix script: use associative array map instead of if/else Agent-Logs-Url: https://github.com/tokidoki11/devcontainer-feature/sessions/0e5ae084-4e5c-41a7-b7a1-75d1447db8c4 Co-authored-by: tokidoki11 <7564844+tokidoki11@users.noreply.github.com> --- .github/workflows/test.yaml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1cb5dad..1445b5f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -34,19 +34,25 @@ jobs: - name: "Compute features matrix" id: compute run: | - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - echo 'features=["cargo-lambda","lambroll","ngrok"]' >> "$GITHUB_OUTPUT" - else - features=() - [ "${{ steps.filter.outputs.cargo-lambda }}" = "true" ] && features+=("cargo-lambda") - [ "${{ steps.filter.outputs.lambroll }}" = "true" ] && features+=("lambroll") - [ "${{ steps.filter.outputs.ngrok }}" = "true" ] && features+=("ngrok") - if [ ${#features[@]} -eq 0 ]; then - echo 'features=[]' >> "$GITHUB_OUTPUT" - else - json=$(printf '%s\n' "${features[@]}" | jq -R . | jq -sc .) - echo "features=$json" >> "$GITHUB_OUTPUT" + all_features=("cargo-lambda" "lambroll" "ngrok") + declare -A changed=( + ["cargo-lambda"]="${{ steps.filter.outputs.cargo-lambda }}" + ["lambroll"]="${{ steps.filter.outputs.lambroll }}" + ["ngrok"]="${{ steps.filter.outputs.ngrok }}" + ) + + features=() + for feature in "${all_features[@]}"; do + if [ "${{ github.event_name }}" = "workflow_dispatch" ] || [ "${changed[$feature]}" = "true" ]; then + features+=("$feature") fi + done + + if [ ${#features[@]} -eq 0 ]; then + echo 'features=[]' >> "$GITHUB_OUTPUT" + else + json=$(printf '%s\n' "${features[@]}" | jq -R . | jq -sc .) + echo "features=$json" >> "$GITHUB_OUTPUT" fi test-autogenerated: From c8cc5d0d113c7f28a35943d2757d0df5bac4c247 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:23:11 +0000 Subject: [PATCH 9/9] Extract feature matrix computation to .github/compute-feature-matrix.sh Agent-Logs-Url: https://github.com/tokidoki11/devcontainer-feature/sessions/09c41b36-ecff-403c-91db-83a6860b25b9 Co-authored-by: tokidoki11 <7564844+tokidoki11@users.noreply.github.com> --- .github/compute-feature-matrix.sh | 29 +++++++++++++++++++++++++++++ .github/workflows/test.yaml | 25 +++++-------------------- 2 files changed, 34 insertions(+), 20 deletions(-) create mode 100755 .github/compute-feature-matrix.sh diff --git a/.github/compute-feature-matrix.sh b/.github/compute-feature-matrix.sh new file mode 100755 index 0000000..ed78711 --- /dev/null +++ b/.github/compute-feature-matrix.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# Usage: compute-feature-matrix.sh +# Outputs a JSON array of feature names to GITHUB_OUTPUT (or stdout when GITHUB_OUTPUT is unset). +set -euo pipefail + +event_name="${1:-}" +shift + +all_features=("cargo-lambda" "lambroll" "ngrok") +declare -A changed=( + ["cargo-lambda"]="${1:-false}" + ["lambroll"]="${2:-false}" + ["ngrok"]="${3:-false}" +) + +features=() +for feature in "${all_features[@]}"; do + if [ "$event_name" = "workflow_dispatch" ] || [ "${changed[$feature]}" = "true" ]; then + features+=("$feature") + fi +done + +if [ ${#features[@]} -eq 0 ]; then + json="[]" +else + json=$(printf '%s\n' "${features[@]}" | jq -R . | jq -sc .) +fi + +echo "features=$json" | tee -a "${GITHUB_OUTPUT:-/dev/stdout}" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1445b5f..fb500c7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -34,26 +34,11 @@ jobs: - name: "Compute features matrix" id: compute run: | - all_features=("cargo-lambda" "lambroll" "ngrok") - declare -A changed=( - ["cargo-lambda"]="${{ steps.filter.outputs.cargo-lambda }}" - ["lambroll"]="${{ steps.filter.outputs.lambroll }}" - ["ngrok"]="${{ steps.filter.outputs.ngrok }}" - ) - - features=() - for feature in "${all_features[@]}"; do - if [ "${{ github.event_name }}" = "workflow_dispatch" ] || [ "${changed[$feature]}" = "true" ]; then - features+=("$feature") - fi - done - - if [ ${#features[@]} -eq 0 ]; then - echo 'features=[]' >> "$GITHUB_OUTPUT" - else - json=$(printf '%s\n' "${features[@]}" | jq -R . | jq -sc .) - echo "features=$json" >> "$GITHUB_OUTPUT" - fi + bash .github/compute-feature-matrix.sh \ + "${{ github.event_name }}" \ + "${{ steps.filter.outputs.cargo-lambda }}" \ + "${{ steps.filter.outputs.lambroll }}" \ + "${{ steps.filter.outputs.ngrok }}" test-autogenerated: needs: compute-feature-matrix