name: Test Kitchen on: - push - pull_request - workflow_dispatch concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} cancel-in-progress: true jobs: kitchen: name: Test Kitchen runs-on: ubuntu-latest permissions: packages: read strategy: matrix: suite: - accounts - apache - apt - apt-repository - awscli - backup - bind - blog - blogs - chef - civicrm - clamav - community - db-backup - db-base - db-master - db-slave - dev - devices - dhcpd - dmca - dns - docker - elasticsearch - exim - fail2ban - fastly - foundation-birthday - foundation-board - foundation-dwg - foundation-mastodon - foundation-mwg - foundation-owg - foundation-welcome - foundation-wiki - ftp - geodns - geoipupdate - git - git-server - git-web - gps-tile - hardware - hot - ideditor - imagery-tiler - irc - letsencrypt - mail - mailman - matomo - memcached - mysql - networking - nginx - nodejs - nominatim - ntp - openssh - osmosis - osqa - otrs - overpass - oxidized - passenger - php - php-apache - php-fpm - planet - planet-aws - planet-current - planet-dump - planet-notes - planet-replication - postgresql - prometheus - prometheus-server - python - rsyncd - serverinfo - snmpd - spamassassin - ssl - stateofthemap-container - stateofthemap-wordpress - subversion - supybot - switch2osm - sysctl - sysfs - taginfo - tile - tilelog - tools - trac - vectortile - web-cgimap - web-frontend - web-rails - wiki - wordpress os: - debian-12 exclude: - suite: mailman os: debian-12 include: - suite: blog os: ubuntu-2004 - suite: mailman os: ubuntu-2004 - suite: stateofthemap-wordpress os: ubuntu-2004 - suite: wordpress os: ubuntu-2004 - suite: accounts os: ubuntu-2204 - suite: apache os: ubuntu-2204 - suite: apt os: ubuntu-2204 - suite: bind os: ubuntu-2204 - suite: chef os: ubuntu-2204 - suite: db-backup os: ubuntu-2204 - suite: db-base os: ubuntu-2204 - suite: db-master os: ubuntu-2204 - suite: db-slave os: ubuntu-2204 - suite: devices os: ubuntu-2204 - suite: dhcpd os: ubuntu-2204 - suite: exim os: ubuntu-2204 - suite: fail2ban os: ubuntu-2204 - suite: git os: ubuntu-2204 - suite: hardware os: ubuntu-2204 - suite: networking os: ubuntu-2204 - suite: ntp os: ubuntu-2204 - suite: openssh os: ubuntu-2204 - suite: postgresql os: ubuntu-2204 - suite: prometheus os: ubuntu-2204 - suite: python os: ubuntu-2204 - suite: rsyncd os: ubuntu-2204 - suite: ssl os: ubuntu-2204 - suite: sysctl os: ubuntu-2204 - suite: sysfs os: ubuntu-2204 - suite: tools os: ubuntu-2204 fail-fast: false steps: - name: Check out code uses: actions/checkout@v6 - name: Extract cinc image details from .kitchen.yml id: cinc-image run: | CINC_IMAGE=$(grep 'chef_image:' .kitchen.yml | head -1 | awk '{print $2}') CINC_VERSION=$(grep 'chef_version:' .kitchen.yml | head -1 | awk '{print $2}') echo "cinc_container_image=${CINC_IMAGE}" >> "$GITHUB_OUTPUT" echo "cinc_container_version=${CINC_VERSION}" >> "$GITHUB_OUTPUT" echo "cinc_container_ref=${CINC_IMAGE}:${CINC_VERSION}" >> "$GITHUB_OUTPUT" - name: Login to GitHub Container Registry uses: docker/login-action@v4 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Cache cinc container image id: cache-cinc uses: actions/cache@v5 with: path: /tmp/cinc-image.tar key: docker-cinc-${{ steps.cinc-image.outputs.cinc_container_version }}-${{ runner.arch }} - name: Pull and save cinc container image if: steps.cache-cinc.outputs.cache-hit != 'true' run: | docker pull "${{ steps.cinc-image.outputs.cinc_container_ref }}" docker save "${{ steps.cinc-image.outputs.cinc_container_ref }}" -o /tmp/cinc-image.tar - name: Load cinc container image from cache if: steps.cache-cinc.outputs.cache-hit == 'true' run: docker load -i /tmp/cinc-image.tar - name: Setup ruby uses: ruby/setup-ruby@v1 with: bundler-cache: true - name: Run kitchen test ${{ matrix.suite }}-${{ matrix.os }} run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} - name: Gather journal output run: | bundle exec kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "journalctl --since=yesterday" bundle exec kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "networkctl status --all" bundle exec kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "resolvectl status" || true if: ${{ failure() }}