diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4033ca9..3f62171 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,12 +13,12 @@ jobs: strategy: matrix: features: - - color - - hello + - conan baseImage: - - debian:latest - - ubuntu:latest + - docker.io/library/ubuntu:latest + - docker.io/library/debian:latest - mcr.microsoft.com/devcontainers/base:ubuntu + - mcr.microsoft.com/devcontainers/base:debian steps: - uses: actions/checkout@v4 @@ -34,8 +34,7 @@ jobs: strategy: matrix: features: - - color - - hello + - conan steps: - uses: actions/checkout@v4 diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..076113c --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,84 @@ +# Dev Container Features Repo + +Template for authoring and publishing [Dev Container Features](https://containers.dev/implementors/features/) to GitHub Container Registry. + +## Repository Structure + +``` +src// + devcontainer-feature.json # Feature metadata, options, version + install.sh # Entrypoint, runs as root during build +test// + scenarios.json # Test scenarios (optional) + test.sh # Auto-generated tests (runs against defaults) + .sh # Per-scenario test scripts +test/_global/ + scenarios.json # Multi-feature integration tests +``` + +## Required CLI + +Install the devcontainer CLI globally: + +```bash +npm install -g @devcontainers/cli +``` + +## Development Commands + +**Validate feature metadata:** +```bash +devcontainer features validate --base-path ./src +``` + +**Test a single feature (auto-generated):** +```bash +devcontainer features test -f --skip-scenarios -i mcr.microsoft.com/devcontainers/base:ubuntu . +``` + +**Test a single feature (scenarios only):** +```bash +devcontainer features test -f --skip-autogenerated . +``` + +**Test global scenarios:** +```bash +devcontainer features test --global-scenarios-only . +``` + +## Feature Implementation Notes + +- `install.sh` always runs as **root** during container build +- Options from `devcontainer-feature.json` are passed as **capitalized env vars** (e.g., `favorite` → `FAVORITE`) +- Use `$_REMOTE_USER` and `$_CONTAINER_USER` for user context if needed +- Feature version is defined in `devcontainer-feature.json` (semver) +- Declare dependencies via `installsAfter` in metadata + +## CI Workflows + +- `.github/workflows/validate.yml`: Validates `devcontainer-feature.json` on PR +- `.github/workflows/test.yaml`: Runs auto-generated + scenario tests on PR/push +- `.github/workflows/release.yaml`: Publishes to GHCR (manual trigger, main branch only) + +## Publishing + +- Namespace: `ghcr.io///:` +- Requires `package:write` permission and GITHUB_TOKEN +- Packages default to **private** in GHCR; must manually set to **public** in package settings +- README auto-generated per feature (merges `src//NOTES.md` if exists) + +## Test Library + +Tests can use the bundled test library: + +```bash +source dev-container-features-test-lib +check "