diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd2d49ea0..56a81aa62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: needs: lint-unit runs-on: ubuntu-latest strategy: + fail-fast: false matrix: os: - almalinux-8 @@ -45,11 +46,16 @@ jobs: - mod-php - module-template - mod-wsgi - - pkg-name - ports - ssl - install-override exclude: + - os: amazonlinux-2023 + suite: mod-wsgi + # TODO: disabled due to https://github.com/chef/chef/pull/13691 + - os: opensuse-leap-15 + suite: mod-wsgi + # mod_php is considered old. PHP-FPM is the new hotness. - os: amazonlinux-2023 suite: mod-php - os: almalinux-9 @@ -60,43 +66,34 @@ jobs: suite: mod-php - os: rockylinux-9 suite: mod-php - - os: amazonlinux-2023 - suite: mod-wsgi - # TODO: disabled due to https://github.com/chef/chef/pull/13691 - - os: opensuse-leap-15 - suite: mod-wsgi - - os: almalinux-8 - suite: pkg-name - - os: almalinux-9 - suite: pkg-name - - os: amazonlinux-2023 - suite: pkg-name - - os: centos-stream-8 - suite: pkg-name - - os: centos-stream-9 - suite: pkg-name - - os: debian-10 - suite: pkg-name - - os: debian-11 - suite: pkg-name - - os: debian-12 - suite: pkg-name - - os: fedora-latest - suite: pkg-name - - os: opensuse-leap-15 - suite: pkg-name - - os: rockylinux-8 - suite: pkg-name - - os: rockylinux-9 - suite: pkg-name - - os: ubuntu-1804 - suite: pkg-name - - os: ubuntu-2004 - suite: pkg-name - - os: ubuntu-2204 - suite: pkg-name - fail-fast: false + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Install Chef + uses: actionshub/chef-install@main + - name: Dokken + uses: actionshub/test-kitchen@main + env: + CHEF_LICENSE: accept-no-persist + KITCHEN_LOCAL_YAML: kitchen.dokken.yml + with: + suite: ${{ matrix.suite }} + os: ${{ matrix.os }} + - name: Print debug output on failure + if: failure() + run: | + set -x + sudo journalctl -l --since today + KITCHEN_LOCAL_YAML=kitchen.dokken.yml /usr/bin/kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "journalctl -l" + integration-pkgname: + needs: lint-unit + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [centos-7] + suite: [pkg-name] steps: - name: Check out code uses: actions/checkout@v4 @@ -116,3 +113,10 @@ jobs: set -x sudo journalctl -l --since today KITCHEN_LOCAL_YAML=kitchen.dokken.yml /usr/bin/kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "journalctl -l" + + final: + runs-on: ubuntu-latest + needs: [integration, integration-pkgname] + steps: + - run: echo ${{needs.integration.outputs}} + - run: echo ${{needs.integration-pkgname.outputs}} diff --git a/CHANGELOG.md b/CHANGELOG.md index 413b8a3df..2163544eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ This file is used to list changes made in each version of the apache2 cookbook. ## Unreleased +- Tidy CI steps +- Tidy Helpers. Switching to ternary operators where sensible + ## 9.0.6 - *2023-10-20* - Fix issue when using apache2_mod_ssl resource instead a wrapper resource diff --git a/libraries/helpers.rb b/libraries/helpers.rb index a8c36395d..2d7a1abb8 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -416,11 +416,8 @@ def apache_mod_php_modulename when 'amazon' 'php8_module' when 'rhel' - if node['platform_version'].to_i >= 8 - 'php7_module' - else - 'php5_module' - end + # TODO: Remove when we no longer support RHEL 7 + node['platform_version'].to_i >= 8 ? 'php7_module' : 'php5_module' when 'debian' if platform?('debian') && node['platform_version'].to_i >= 12 'php_module' @@ -453,11 +450,8 @@ def apache_mod_php_filename 'libphp7.0.so' end when 'rhel' - if node['platform_version'].to_i >= 8 - 'libphp7.so' - else - 'libphp5.so' - end + # TODO: Remove when we no longer support RHEL 7 + node['platform_version'].to_i >= 8 ? 'libphp7.so' : 'libphp5.so' when 'suse' 'mod_php7.so' end @@ -469,11 +463,8 @@ def apache_mod_wsgi_package when 'debian' 'libapache2-mod-wsgi-py3' when 'rhel', 'fedora' - if node['platform_version'].to_i >= 8 - 'python3-mod_wsgi' - else - 'mod_wsgi' - end + # TODO: Remove when we no longer support RHEL 7 + node['platform_version'].to_i >= 8 ? 'python3-mod_wsgi' : 'mod_wsgi' when 'suse' 'apache2-mod_wsgi-python3' end @@ -488,6 +479,7 @@ def apache_mod_wsgi_filename end def apache_mod_auth_cas_install_method + # TODO: Simplify when we no longer support RHEL 7 if (platform_family?('rhel') && node['platform_version'].to_i >= 8) || platform_family?('suse', 'fedora', 'amazon') 'source' else diff --git a/spec/libraries/mod_wsgi_spec.rb b/spec/libraries/mod_wsgi_spec.rb index b104261a2..c1e494a1a 100644 --- a/spec/libraries/mod_wsgi_spec.rb +++ b/spec/libraries/mod_wsgi_spec.rb @@ -84,7 +84,7 @@ class DummyClass < Chef::Node context 'amazonlinux' do let(:platform_family) { 'amazon' } - let(:platform_version) { '2018.03' } + let(:platform_version) { '2' } it { expect(subject.apache_mod_wsgi_filename).to eq 'mod_wsgi.so' } end