From e8edc06cd203b0ed9a196d7bb8e3dcc5d5ddbf1b Mon Sep 17 00:00:00 2001 From: Ihor Kalnytskyi Date: Sun, 6 Jul 2025 02:15:09 +0300 Subject: [PATCH] Remove retired runners from CI Both Ubuntu 20.04 and Windows 2019 runners have been retired and are no longer available. --- .github/workflows/ci.yml | 6 ++---- action.yml | 9 --------- tests/test_action.py | 28 +++++++--------------------- 3 files changed, 9 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4331c3fde..0002041b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,14 +18,13 @@ jobs: strategy: matrix: os: - - ubuntu-20.04 - ubuntu-22.04 - ubuntu-24.04 - macos-13 - macos-14 - macos-15 - - windows-2019 - windows-2022 + - windows-2025 steps: - uses: actions/checkout@v4 @@ -56,14 +55,13 @@ jobs: strategy: matrix: os: - - ubuntu-20.04 - ubuntu-22.04 - ubuntu-24.04 - macos-13 - macos-14 - macos-15 - - windows-2019 - windows-2022 + - windows-2025 postgres-version: - "14" - "15" diff --git a/action.yml b/action.yml index 0a1ec6c13..d6bcb7cdf 100644 --- a/action.yml +++ b/action.yml @@ -111,15 +111,6 @@ runs: DEFAULT_ENCODING="UTF-8" DEFAULT_LOCALE="en_US.$DEFAULT_ENCODING" - # Unfortunately, Windows Server 2019 doesn't understand locale - # specified in the format defined by the POSIX standard, i.e. - # _.. Therefore, we have to convert it - # into something it can swallow, i.e. -. - if [[ "$RUNNER_OS" == "Windows" && "$(wmic os get Caption)" == *"2019"* ]]; then - DEFAULT_LOCALE="${DEFAULT_LOCALE%%.*}" - DEFAULT_LOCALE="${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. diff --git a/tests/test_action.py b/tests/test_action.py index fef0ba983..3865ed15f 100644 --- a/tests/test_action.py +++ b/tests/test_action.py @@ -20,17 +20,6 @@ def is_windows() -> bool: return os.name == "nt" -@pytest.fixture(scope="function") -def is_windows_server_2019(is_windows: bool) -> bool: - """Returns True if running on Windows Server 2019.""" - - if not is_windows: - return False - - windows_caption = subprocess.check_output(["wmic", "os", "get", "Caption"], text=True) - return "Windows Server 2019" in windows_caption - - @pytest.fixture(scope="function") def connection_uri() -> str: """Read and return connection URI from environment.""" @@ -108,27 +97,24 @@ def test_server_encoding(connection: psycopg.Connection): assert connection.execute("SHOW SERVER_ENCODING").fetchone()[0] == "UTF8" -def test_locale(connection: psycopg.Connection, is_windows_server_2019: bool): - """Test that PostgreSQL's locale matches the one we paased to initdb.""" - - locale_exp = "en_US.UTF-8" +def test_locale(connection: psycopg.Connection): + """Test that PostgreSQL's locale matches the one we passed to initdb.""" - if is_windows_server_2019: - locale_exp = "en-US" + locale_expected = "en_US.UTF-8" record = connection \ .execute("SELECT datcollate, datctype FROM pg_database WHERE datname = 'template0'") \ .fetchone() assert record - assert locale.normalize(record[0]) == locale_exp - assert locale.normalize(record[1]) == locale_exp + assert locale.normalize(record[0]) == locale_expected + assert locale.normalize(record[1]) == locale_expected record = connection \ .execute("SELECT datcollate, datctype FROM pg_database WHERE datname = 'template1'") \ .fetchone() assert record - assert locale.normalize(record[0]) == locale_exp - assert locale.normalize(record[1]) == locale_exp + assert locale.normalize(record[0]) == locale_expected + assert locale.normalize(record[1]) == locale_expected def test_environment_variables(is_windows: bool):