diff --git a/.github/actions/kitchen-test/action.yml b/.github/actions/kitchen-test/action.yml new file mode 100644 index 0000000..8298420 --- /dev/null +++ b/.github/actions/kitchen-test/action.yml @@ -0,0 +1,28 @@ +name: 'Kitchen Test' +description: 'Runs Test Kitchen tests for a specific suite' + +inputs: + suite: + description: 'Test suite to run' + required: true + os: + description: 'OS to test against' + required: true + +runs: + using: composite + steps: + - name: Install VirtualBox + shell: bash + run: | + brew update + brew install virtualbox vagrant + + - name: Install Chef + uses: actionshub/chef-install@3.0.1 + + - name: Kitchen Converge + uses: actionshub/test-kitchen@2.1.0 + with: + suite: ${{ inputs.suite }} + os: ${{ inputs.os }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e98d62..b313163 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,48 +15,97 @@ jobs: statuses: write issues: write - integration: + firewalld: needs: lint-unit runs-on: macos-latest strategy: matrix: - include: - - os: amazonlinux-2 - suite: firewalld - - os: amazonlinux-2 - suite: iptables - - os: centos-7 - suite: firewalld - - os: centos-7 - suite: iptables - - os: centos-stream-8 - suite: iptables - - os: debian-9 - suite: ufw - - os: debian-10 - suite: ufw - - os: debian-11 - suite: firewalld-dbus - - os: debian-11 - suite: nftables - - os: ubuntu-1804 - suite: ufw - - os: ubuntu-2004 - suite: ufw + os: + - amazonlinux-2 + - centos-7 + - debian-11 + - debian-12 fail-fast: false steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install VirtualBox - run: | - brew update - brew upgrade virtualbox - - name: Install Chef - uses: actionshub/chef-install@3.0.1 - - name: kitchen - uses: actionshub/test-kitchen@3.0.0 - env: - CHEF_LICENSE: accept-no-persist + - uses: ./.github/actions/kitchen-test with: - suite: ${{ matrix.suite }} + suite: firewalld os: ${{ matrix.os }} + + iptables: + needs: lint-unit + runs-on: macos-latest + strategy: + matrix: + os: + - amazonlinux-2 + - centos-7 + - centos-stream-8 + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + - uses: ./.github/actions/kitchen-test + with: + suite: iptables + os: ${{ matrix.os }} + + ufw: + needs: lint-unit + runs-on: macos-latest + strategy: + matrix: + os: + - ubuntu-2004 + - ubuntu-2204 + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + - uses: ./.github/actions/kitchen-test + with: + suite: ufw + os: ${{ matrix.os }} + + nftables: + needs: lint-unit + runs-on: macos-latest + strategy: + matrix: + os: + - debian-11 + - debian-12 + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + - uses: ./.github/actions/kitchen-test + with: + suite: nftables + os: ${{ matrix.os }} + + firewalld-dbus: + needs: lint-unit + runs-on: macos-latest + strategy: + matrix: + os: + - debian-11 + - debian-12 + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + - uses: ./.github/actions/kitchen-test + with: + suite: firewalld-dbus + os: ${{ matrix.os }} + + verify: + needs: [firewalld, iptables, ufw, nftables, firewalld-dbus] + runs-on: ubuntu-latest + steps: + - name: Success + run: echo "All test suites completed successfully!" diff --git a/kitchen.yml b/kitchen.yml index 4791d8d..c9e27e8 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -25,23 +25,23 @@ platforms: - name: amazonlinux-2 - name: centos-7 - name: centos-stream-8 - - name: debian-9 - - name: debian-10 - name: debian-11 - - name: fedora-34 + - name: debian-12 + - name: fedora-38 + - name: fedora-39 - name: fedora-latest - - name: freebsd-11 - name: freebsd-12 + - name: freebsd-13 - name: opensuse-leap-15 - name: oracle-8 - - name: ubuntu-18.04 - name: ubuntu-20.04 - - name: windows-2016 - driver_config: - box: tas50/windows_2016 + - name: ubuntu-22.04 - name: windows-2019 driver_config: box: tas50/windows_2019 + - name: windows-2022 + driver_config: + box: tas50/windows_2022 suites: - name: default