Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/ci-test-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,25 @@ jobs:
features=$(ls -d features/src/*/ | xargs -n1 basename | jq -R -s -c 'split("\n")[:-1]')
elif [ "${{ github.event_name }}" = "pull_request" ]; then
base="${{ github.event.pull_request.base.sha }}"
features=$(git diff --name-only "$base" HEAD -- features/src/ | cut -d/ -f3 | sort -u | jq -R -s -c 'split("\n")[:-1]')
features=$(git diff --name-only "$base" HEAD -- features/src/ features/test/ | cut -d/ -f3 | sort -u | jq -R -s -c 'split("\n")[:-1]')
else
features=$(git diff --name-only "${{ github.event.before }}" HEAD -- features/src/ | cut -d/ -f3 | sort -u | jq -R -s -c 'split("\n")[:-1]')
features=$(git diff --name-only "${{ github.event.before }}" HEAD -- features/src/ features/test/ | cut -d/ -f3 | sort -u | jq -R -s -c 'split("\n")[:-1]')
fi
echo "features=$features" >> $GITHUB_OUTPUT

test:
needs: detect
runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
feature: ${{ fromJson(needs.detect.outputs.features) }}
arch: [amd64, arm64]
include:
- arch: amd64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down
4 changes: 2 additions & 2 deletions features/src/gcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Installs [Google Cloud CLI](https://cloud.google.com/sdk/gcloud) via the officia
## Requirements

- `curl` and `tar` must be available in the container
- Linux (x86_64 or aarch64)
- aarch64: Python 3.9-3.14 must be installed (x86_64 bundles Python)
- Linux x86_64 or aarch64 (glibc-based; Alpine/musl is not supported)
- A Python 3 with the `sqlite3` stdlib module. If missing, the feature installs `python3` via `apt-get` (tested on Debian and Ubuntu). If a `python` feature is also added, its Python is reused.

## Using host credentials

Expand Down
2 changes: 1 addition & 1 deletion features/src/gcloud/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "gcloud",
"version": "1.0.0",
"version": "1.0.1",
"name": "Google Cloud CLI",
"documentationURL": "https://github.com/shokkunrf/devcontainer/tree/develop/features/src/gcloud/README.md",
"description": "Installs Google Cloud CLI via the official tarball",
Expand Down
20 changes: 20 additions & 0 deletions features/src/gcloud/install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
# References:
# - https://cloud.google.com/sdk/docs/install-sdk
# - https://github.com/GoogleCloudPlatform/cloud-sdk-docker

set -eu

Expand All @@ -17,10 +18,29 @@ case "$ARCH" in
;;
esac

# gcloud needs a system python3 with the sqlite3 stdlib module
# (arm tarball ships no bundled Python; some minimal images ship python3 without libsqlite3).
if ! command -v python3 >/dev/null 2>&1 || ! python3 -c 'import sqlite3' >/dev/null 2>&1; then
if ! command -v apt-get >/dev/null 2>&1; then
echo "ERROR: python3 with sqlite3 is required but apt-get is not available"
exit 1
fi
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends python3 libsqlite3-0
rm -rf /var/lib/apt/lists/*
fi

INSTALL_DIR="/usr/local"
TARBALL="google-cloud-cli-linux-${ARCH_SUFFIX}.tar.gz"
curl -fsSL "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/${TARBALL}" | tar -xz -C "$INSTALL_DIR"

# Drop the x86_64-only bundled Python so every arch uses the system one.
rm -rf "${INSTALL_DIR}/google-cloud-sdk/platform/bundledpythonunix"

CLOUDSDK_PYTHON="$(command -v python3)"
export CLOUDSDK_PYTHON

"${INSTALL_DIR}/google-cloud-sdk/install.sh" --quiet --path-update false --command-completion false

ln -s "${INSTALL_DIR}/google-cloud-sdk/bin/gcloud" /usr/local/bin/gcloud
Expand Down
7 changes: 7 additions & 0 deletions features/test/bun/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,12 @@
"bun": {}
},
"remoteUser": "vscode"
},
"shokkunrf-base": {
"image": "ghcr.io/shokkunrf/devcontainer-images/base:latest",
"features": {
"bun": {}
},
"remoteUser": "developer"
}
}
1 change: 1 addition & 0 deletions features/test/bun/shokkunrf-base.sh
7 changes: 7 additions & 0 deletions features/test/claude-code/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,12 @@
"claude-code": {}
},
"remoteUser": "vscode"
},
"shokkunrf-base": {
"image": "ghcr.io/shokkunrf/devcontainer-images/base:latest",
"features": {
"claude-code": {}
},
"remoteUser": "developer"
}
}
1 change: 1 addition & 0 deletions features/test/claude-code/shokkunrf-base.sh
15 changes: 15 additions & 0 deletions features/test/gcloud/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
},
"remoteUser": "vscode"
},
"devcontainer-base-debian-with-python": {
"image": "mcr.microsoft.com/devcontainers/base:debian",
"features": {
"ghcr.io/devcontainers/features/python:1": {},
"gcloud": {}
},
"remoteUser": "vscode"
},
"devcontainer-base-ubuntu-root": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
Expand All @@ -25,5 +33,12 @@
"gcloud": {}
},
"remoteUser": "vscode"
},
"shokkunrf-base": {
"image": "ghcr.io/shokkunrf/devcontainer-images/base:latest",
"features": {
"gcloud": {}
},
"remoteUser": "developer"
}
}
1 change: 1 addition & 0 deletions features/test/gcloud/shokkunrf-base.sh
9 changes: 9 additions & 0 deletions features/test/node-packages/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,14 @@
}
},
"remoteUser": "node"
},
"shokkunrf-base": {
"image": "ghcr.io/shokkunrf/devcontainer-images/base:latest",
"features": {
"node-packages": {
"packages": "@devcontainers/cli,prettier,@google/gemini-cli"
}
},
"remoteUser": "developer"
}
}
1 change: 1 addition & 0 deletions features/test/node-packages/shokkunrf-base.sh
7 changes: 7 additions & 0 deletions features/test/wd/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,12 @@
"wd": {}
},
"remoteUser": "vscode"
},
"shokkunrf-base": {
"image": "ghcr.io/shokkunrf/devcontainer-images/base:latest",
"features": {
"wd": {}
},
"remoteUser": "developer"
}
}
1 change: 1 addition & 0 deletions features/test/wd/shokkunrf-base.sh