9 group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
10 cancel-in-progress: true
15 runs-on: ubuntu-latest
177 - name: Check out code
178 uses: actions/checkout@v7
179 - name: Extract cinc image details from .kitchen.yml
182 CINC_IMAGE=$(grep 'chef_image:' .kitchen.yml | head -1 | awk '{print $2}')
183 CINC_VERSION=$(grep 'chef_version:' .kitchen.yml | head -1 | awk '{print $2}')
184 echo "cinc_container_image=${CINC_IMAGE}" >> "$GITHUB_OUTPUT"
185 echo "cinc_container_version=${CINC_VERSION}" >> "$GITHUB_OUTPUT"
186 echo "cinc_container_ref=${CINC_IMAGE}:${CINC_VERSION}" >> "$GITHUB_OUTPUT"
187 - name: Login to GitHub Container Registry
188 uses: docker/login-action@v4
191 username: ${{ github.actor }}
192 password: ${{ secrets.GITHUB_TOKEN }}
193 - name: Cache cinc container image
195 uses: actions/cache@v6
197 path: /tmp/cinc-image.tar
198 key: docker-cinc-${{ steps.cinc-image.outputs.cinc_container_version }}-${{ runner.arch }}
199 - name: Pull and save cinc container image
200 if: steps.cache-cinc.outputs.cache-hit != 'true'
202 docker pull "${{ steps.cinc-image.outputs.cinc_container_ref }}"
203 docker save "${{ steps.cinc-image.outputs.cinc_container_ref }}" -o /tmp/cinc-image.tar
204 - name: Load cinc container image from cache
205 if: steps.cache-cinc.outputs.cache-hit == 'true'
206 run: docker load -i /tmp/cinc-image.tar
208 uses: ruby/setup-ruby@v1
211 - name: Run kitchen test ${{ matrix.suite }}-${{ matrix.os }}
212 run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }}
213 - name: Gather journal output
215 bundle exec kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "journalctl --since=yesterday"
216 bundle exec kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "networkctl status --all"
217 bundle exec kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "resolvectl status" || true