Skip to content

Commit

Permalink
Move pkg-name into it's own CI step. (#801)
Browse files Browse the repository at this point in the history
* Move pkg-name into its own CI step.
  This makes it more readable and we don't need to write so many excludes
---------

Signed-off-by: Dan Webb <[email protected]>
  • Loading branch information
damacus authored Oct 25, 2023
1 parent 673cc6b commit 8d67ea2
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 53 deletions.
78 changes: 41 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
needs: lint-unit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- almalinux-8
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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}}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 7 additions & 15 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/libraries/mod_wsgi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8d67ea2

Please sign in to comment.