diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ae9a6f4..6dd8a9d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: strategy: matrix: os: + - ubuntu-slim - ubuntu-22.04 - ubuntu-22.04-arm - ubuntu-24.04 @@ -67,6 +68,7 @@ jobs: strategy: matrix: os: + - ubuntu-slim - ubuntu-22.04 - ubuntu-22.04-arm - ubuntu-24.04 diff --git a/action.yml b/action.yml index 2614c1f1..7dfbcf12 100644 --- a/action.yml +++ b/action.yml @@ -118,6 +118,14 @@ runs: DEFAULT_ENCODING="UTF-8" DEFAULT_LOCALE="en_US.$DEFAULT_ENCODING" + # Some runners (e.g., `ubuntu-slim`) may not include the `en_US.UTF-8` + # locale by default. Ensure the required locale exists by generating it + # if missing. + if ! python -c "from locale import *; setlocale(LC_ALL, '$DEFAULT_LOCALE')" \ + >/dev/null 2>&1; then + sudo locale-gen "$DEFAULT_LOCALE" + fi + # Unfortunately 'initdb' could only receive a password via file on disk # or prompt to enter on. Prompting is not an option since we're running # in non-interactive mode.