diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ee45f3c..0c94d54 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,6 +26,7 @@ jobs: test-autogenerated: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: features: - aws-ssm-session-manager-plugin @@ -44,6 +45,7 @@ jobs: test-scenarios: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: features: - aws-ssm-session-manager-plugin diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 53743c8..6dd32f2 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,12 +1,12 @@ { - "version": "2.0.0", - "tasks": [ - { - "label": "Test current feature", - "type": "shell", - "command": "devcontainer features test --features \"$(basename ${fileDirname})\" --base-image ubuntu", - "group": "test", - "problemMatcher": [] - } - ] + "version": "2.0.0", + "tasks": [ + { + "label": "Devcontainers: Test current feature", + "type": "shell", + "command": "devcontainer features test --features \"$(basename ${fileDirname})\" --base-image ubuntu", + "group": "test", + "problemMatcher": [] + } + ] } diff --git a/src/openapi-generator-cli/devcontainer-feature.json b/src/openapi-generator-cli/devcontainer-feature.json index 0a55c4c..415f394 100644 --- a/src/openapi-generator-cli/devcontainer-feature.json +++ b/src/openapi-generator-cli/devcontainer-feature.json @@ -1,13 +1,18 @@ { "name": "OpenAPI Generator CLI", "id": "openapi-generator-cli", - "version": "0.1.0", - "description": "A feature to install OpenAPI Generator CLI. Java is required but not included in this feature.", + "version": "0.2.0", + "description": "A feature to install OpenAPI Generator CLI.", "options": { "version": { "type": "string", "default": "latest", "description": "The version of OpenAPI Generator CLI to install." + }, + "install-java": { + "type": "boolean", + "default": false, + "description": "Whether to install Java (default-jre) via APT." } }, "installsAfter": [ diff --git a/src/openapi-generator-cli/install.sh b/src/openapi-generator-cli/install.sh index fed333b..7a441de 100644 --- a/src/openapi-generator-cli/install.sh +++ b/src/openapi-generator-cli/install.sh @@ -4,6 +4,11 @@ set -e apt-get update && apt-get install -y curl +if [ "$INSTALL_JAVA" = 'true' ]; then + echo "Installing default-jre as \$INSTALL_JAVA is set to true" + apt-get install -y default-jre +fi + if [ "$VERSION" = 'latest' ]; then echo "Resolving latest version of OpenAPI Generator CLI" VERSION=$( diff --git a/test/openapi-generator-cli/latest.sh b/test/openapi-generator-cli/latest-with-java.sh similarity index 75% rename from test/openapi-generator-cli/latest.sh rename to test/openapi-generator-cli/latest-with-java.sh index e6314b6..715aea9 100644 --- a/test/openapi-generator-cli/latest.sh +++ b/test/openapi-generator-cli/latest-with-java.sh @@ -5,6 +5,7 @@ set -e # shellcheck source=/dev/null source dev-container-features-test-lib +check "verify Java installation" java --version | grep -Eo 'openjdk .+$' check "verify OpenAPI Generator CLI installation" openapi-generator-cli --version | grep -Eo '^openapi-generator-cli .+$' reportResults diff --git a/test/openapi-generator-cli/scenarios.json b/test/openapi-generator-cli/scenarios.json index 1cadca9..db0675c 100644 --- a/test/openapi-generator-cli/scenarios.json +++ b/test/openapi-generator-cli/scenarios.json @@ -1,9 +1,10 @@ { - "latest": { + "latest-with-java": { "image": "mcr.microsoft.com/devcontainers/base:bookworm", "features": { - "ghcr.io/devcontainers/features/java:1": {}, - "openapi-generator-cli": {} + "openapi-generator-cli": { + "install-java": true + } } }, "specific-version": {