From 94b61ec940e35cb2680a90abef53b76789d6ac01 Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 7 Nov 2024 10:45:20 -0700 Subject: [PATCH] Add back other OS's for testing --- .github/workflows/ci.yml | 273 ++++++++++++++++++++++++ .github/workflows/templates/generate.py | 172 ++++++++++++++- tests/requirements.txt | 2 +- 3 files changed, 443 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39f042d7e..eebfa5191 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,6 +114,37 @@ jobs: + macos-12: + name: macOS 12 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-macos.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: macos-12 + display-name: macOS 12 + timeout: 20 + runs-on: macos-12 + instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' + + + macos-13: + name: macOS 13 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-macos.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: macos-13 + display-name: macOS 13 + timeout: 20 + runs-on: macos-13 + instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]' + + + windows-2022: name: Windows 2022 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -130,6 +161,202 @@ jobs: + almalinux-8: + name: AlmaLinux 8 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: almalinux-8 + display-name: AlmaLinux 8 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + + + almalinux-9: + name: AlmaLinux 9 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: almalinux-9 + display-name: AlmaLinux 9 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + amazon-2: + name: Amazon 2 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: amazon-2 + display-name: Amazon 2 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + + + centos-stream9: + name: CentOS Stream 9 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: centos-stream9 + display-name: CentOS Stream 9 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + debian-11: + name: Debian 11 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: debian-11 + display-name: Debian 11 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + debian-12: + name: Debian 12 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: debian-12 + display-name: Debian 12 + timeout: 20 + instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + fedora-39: + name: Fedora 39 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: fedora-39 + display-name: Fedora 39 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + + + fedora-40: + name: Fedora 40 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: fedora-40 + display-name: Fedora 40 + timeout: 20 + instances: '["stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + opensuse-15: + name: Opensuse 15 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: opensuse-15 + display-name: Opensuse 15 + timeout: 20 + instances: '["latest", "default"]' + + + oraclelinux-8: + name: Oracle Linux 8 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: oraclelinux-8 + display-name: Oracle Linux 8 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + + + oraclelinux-9: + name: Oracle Linux 9 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: oraclelinux-9 + display-name: Oracle Linux 9 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + photon-4: + name: Photon OS 4 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: photon-4 + display-name: Photon OS 4 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + + + photon-5: + name: Photon OS 5 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: photon-5 + display-name: Photon OS 5 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]' + + + rockylinux-8: + name: Rocky Linux 8 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: rockylinux-8 + display-name: Rocky Linux 8 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]' + + rockylinux-9: name: Rocky Linux 9 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -144,6 +371,34 @@ jobs: instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + ubuntu-2004: + name: Ubuntu 20.04 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: ubuntu-2004 + display-name: Ubuntu 20.04 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + + ubuntu-2204: + name: Ubuntu 22.04 + if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' + uses: ./.github/workflows/test-linux.yml + needs: + - lint + - generate-actions-workflow + with: + distro-slug: ubuntu-2204 + display-name: Ubuntu 22.04 + timeout: 20 + instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]' + + ubuntu-2404: name: Ubuntu 24.04 if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true' @@ -166,8 +421,26 @@ jobs: needs: - lint - generate-actions-workflow + - macos-12 + - macos-13 - windows-2022 + - almalinux-8 + - almalinux-9 + - amazon-2 + - centos-stream9 + - debian-11 + - debian-12 + - fedora-39 + - fedora-40 + - opensuse-15 + - oraclelinux-8 + - oraclelinux-9 + - photon-4 + - photon-5 + - rockylinux-8 - rockylinux-9 + - ubuntu-2004 + - ubuntu-2204 - ubuntu-2404 if: always() steps: diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index 3d842dd4f..537d1da5e 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -7,45 +7,143 @@ os.chdir(os.path.abspath(os.path.dirname(__file__))) LINUX_DISTROS = [ + "almalinux-8", + "almalinux-9", + "amazon-2", + "centos-stream9", + "debian-11", + "debian-12", + "fedora-39", + "fedora-40", + "opensuse-15", + "oraclelinux-8", + "oraclelinux-9", + "photon-4", + "photon-5", + "rockylinux-8", "rockylinux-9", + "ubuntu-2004", + "ubuntu-2204", "ubuntu-2404", ] + WINDOWS = [ "windows-2022", ] +OSX = [ + "macos-12", + "macos-13", +] + STABLE_DISTROS = [ + "almalinux-8", + "almalinux-9", + "amazon-2", + "centos-stream9", + "debian-11", + "debian-12", + "fedora-39", + "fedora-40", + "opensuse-15", + "oraclelinux-8", + "oraclelinux-9", + "photon-4", + "photon-5", + "rockylinux-8", "rockylinux-9", + "ubuntu-2004", + "ubuntu-2204", "ubuntu-2404", ] ONEDIR_DISTROS = [ + "almalinux-8", + "almalinux-9", + "amazon-2", + "centos-stream9", + "debian-11", + "debian-12", + "fedora-39", + "fedora-40", + "oraclelinux-8", + "oraclelinux-9", + "photon-4", + "photon-5", + "rockylinux-8", "rockylinux-9", + "ubuntu-2004", + "ubuntu-2204", "ubuntu-2404", ] ONEDIR_RC_DISTROS = [ + "almalinux-9", + "amazon-2", + "centos-stream9", + "debian-12", + "oraclelinux-9", + "photon-4", + "photon-5", "rockylinux-9", "ubuntu-2404", ] BLACKLIST_3006 = [ + "debian-12", + "fedora-40", + "opensuse-15", "ubuntu-2404", ] -BLACKLIST_3007 = [] +BLACKLIST_3007 = [ + "fedora-39", + "opensuse-15", + "photon-4", + "photon-5", +] BLACKLIST_GIT_3006 = [ + "almalinux-9", + "amazon-2", + "centos-stream9", + "debian-11", + "debian-12", + "fedora-40", + "opensuse-15", + "oraclelinux-9", + "photon-4", + "photon-5", "rockylinux-9", + "ubuntu-2004", + "ubuntu-2204", "ubuntu-2404", ] BLACKLIST_GIT_3007 = [ + "almalinux-9", + "amazon-2", + "centos-stream9", + "debian-11", + "debian-12", + "fedora-39", + "fedora-40", + "opensuse-15", + "oraclelinux-9", + "photon-4", + "photon-5", "rockylinux-9", + "ubuntu-2004", + "ubuntu-2204", "ubuntu-2404", ] -BLACKLIST_GIT_MASTER = [] +BLACKLIST_GIT_MASTER = [ + "amazon-2", + "fedora-39", + "photon-4", + "photon-5", +] SALT_VERSIONS = [ "3006", @@ -100,13 +198,37 @@ # SetuptoolsDeprecationWarning: setup.py install is deprecated. # Use build and pip and other standards-based tools. # -GIT_DISTRO_BLACKLIST = [] +GIT_DISTRO_BLACKLIST = [ + "almalinux-8", + "fedora-39", + "opensuse-15", + "oraclelinux-8", + "rockylinux-8", +] LATEST_PKG_BLACKLIST = [] DISTRO_DISPLAY_NAMES = { + "almalinux-8": "AlmaLinux 8", + "almalinux-9": "AlmaLinux 9", + "amazon-2": "Amazon 2", + "centos-stream9": "CentOS Stream 9", + "debian-11": "Debian 11", + "debian-12": "Debian 12", + "fedora-39": "Fedora 39", + "fedora-40": "Fedora 40", + "opensuse-15": "Opensuse 15", + "oraclelinux-8": "Oracle Linux 8", + "oraclelinux-9": "Oracle Linux 9", + "photon-4": "Photon OS 4", + "photon-5": "Photon OS 5", + "rockylinux-8": "Rocky Linux 8", "rockylinux-9": "Rocky Linux 9", + "ubuntu-2004": "Ubuntu 20.04", + "ubuntu-2204": "Ubuntu 22.04", "ubuntu-2404": "Ubuntu 24.04", + "macos-12": "macOS 12", + "macos-13": "macOS 13", "windows-2022": "Windows 2022", } @@ -133,6 +255,50 @@ def generate_test_jobs(): test_jobs = "" needs = ["lint", "generate-actions-workflow"] + test_jobs += "\n" + for distro in OSX: + test_jobs += "\n" + runs_on = distro + runs_on = f"\n runs-on: {runs_on}" + ifcheck = "\n if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'" + uses = "./.github/workflows/test-macos.yml" + instances = [] + timeout_minutes = ( + TIMEOUT_OVERRIDES[distro] + if distro in TIMEOUT_OVERRIDES + else TIMEOUT_DEFAULT + ) + + for salt_version in SALT_VERSIONS: + if salt_version == "latest": + instances.append(salt_version) + continue + + for bootstrap_type in ["stable"]: + if bootstrap_type == "stable": + if salt_version in MAC_STABLE_VERSION_BLACKLIST: + continue + + test_target = f"{bootstrap_type}-{salt_version}" + instances.append(test_target) + + for bootstrap_type in ["default"]: + if distro not in STABLE_DISTROS: + continue + instances.append(bootstrap_type) + + if instances: + needs.append(distro) + test_jobs += TEMPLATE.format( + distro=distro, + runs_on=runs_on, + uses=uses, + ifcheck=ifcheck, + instances=json.dumps(instances), + display_name=DISTRO_DISPLAY_NAMES[distro], + timeout_minutes=timeout_minutes, + ) + test_jobs += "\n" for distro in WINDOWS: test_jobs += "\n" diff --git a/tests/requirements.txt b/tests/requirements.txt index 16d3b7789..547de5c5b 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,2 +1,2 @@ pytest -requests \ No newline at end of file +requests