]> git.openstreetmap.org Git - chef.git/blob - .github/workflows/test-kitchen.yml
foundation: use default mediawiki version
[chef.git] / .github / workflows / test-kitchen.yml
1 name: Test Kitchen
2
3 on:
4   - push
5   - pull_request
6   - workflow_dispatch
7
8 concurrency:
9   group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
10   cancel-in-progress: true
11
12 jobs:
13   kitchen:
14     name: Test Kitchen
15     runs-on: ubuntu-latest
16     permissions:
17       packages: read
18     strategy:
19       matrix:
20         suite:
21           - accounts
22           - apache
23           - apt
24           - apt-repository
25           - awscli
26           - backup
27           - bind
28           - blog
29           - blogs
30           - chef
31           - civicrm
32           - clamav
33           - community
34           - db-backup
35           - db-base
36           - db-master
37           - db-slave
38           - dev
39           - devices
40           - dhcpd
41           - dmca
42           - dns
43           - docker
44           - elasticsearch
45           - exim
46           - fail2ban
47           - fastly
48           - foundation-birthday
49           - foundation-board
50           - foundation-dwg
51           - foundation-mastodon
52           - foundation-mwg
53           - foundation-owg
54           - foundation-welcome
55           - foundation-wiki
56           - ftp
57           - geodns
58           - geoipupdate
59           - git
60           - git-server
61           - git-web
62           - glitchtip
63           - gps-tile
64           - hardware
65           - hot
66           - ideditor
67           - imagery-tiler
68           - irc
69           - letsencrypt
70           - mail
71           - mailman
72           - matomo
73           - memcached
74           - mysql
75           - networking
76           - nginx
77           - nodejs
78           - nominatim
79           - ntp
80           - openssh
81           - osmosis
82           - osqa
83           - otrs
84           - overpass
85           - oxidized
86           - passenger
87           - php
88           - planet
89           - planet-aws
90           - planet-current
91           - planet-dump
92           - planet-notes
93           - planet-replication
94           - postgresql
95           - prometheus
96           - prometheus-server
97           - python
98           - rsyncd
99           - serverinfo
100           - snmpd
101           - spamassassin
102           - ssl
103           - stateofthemap-container
104           - stateofthemap-wordpress
105           - subversion
106           - supybot
107           - switch2osm
108           - sysctl
109           - sysfs
110           - taginfo
111           - tile
112           - tilelog
113           - tools
114           - trac
115           - valkey
116           - vectortile
117           - web-cgimap
118           - web-frontend
119           - web-rails
120           - wiki
121           - wordpress
122         os:
123           - debian-13
124         exclude:
125           - suite: mailman
126             os: debian-13
127         include:
128           - suite: blog
129             os: ubuntu-2004
130           - suite: mailman
131             os: ubuntu-2004
132           - suite: stateofthemap-wordpress
133             os: ubuntu-2004
134           - suite: wordpress
135             os: ubuntu-2004
136           - suite: accounts
137             os: ubuntu-2204
138           - suite: apt
139             os: ubuntu-2204
140           - suite: chef
141             os: ubuntu-2204
142           - suite: db-backup
143             os: ubuntu-2204
144           - suite: db-base
145             os: ubuntu-2204
146           - suite: db-master
147             os: ubuntu-2204
148           - suite: db-slave
149             os: ubuntu-2204
150           - suite: devices
151             os: ubuntu-2204
152           - suite: exim
153             os: ubuntu-2204
154           - suite: fail2ban
155             os: ubuntu-2204
156           - suite: git
157             os: ubuntu-2204
158           - suite: hardware
159             os: ubuntu-2204
160           - suite: networking
161             os: ubuntu-2204
162           - suite: ntp
163             os: ubuntu-2204
164           - suite: openssh
165             os: ubuntu-2204
166           - suite: postgresql
167             os: ubuntu-2204
168           - suite: prometheus
169             os: ubuntu-2204
170           - suite: rsyncd
171             os: ubuntu-2204
172           - suite: sysctl
173             os: ubuntu-2204
174           - suite: sysfs
175             os: ubuntu-2204
176           - suite: tools
177             os: ubuntu-2204
178       fail-fast: false
179     steps:
180     - name: Check out code
181       uses: actions/checkout@v7
182     - name: Extract cinc image details from .kitchen.yml
183       id: cinc-image
184       run: |
185         CINC_IMAGE=$(grep 'chef_image:' .kitchen.yml | head -1 | awk '{print $2}')
186         CINC_VERSION=$(grep 'chef_version:' .kitchen.yml | head -1 | awk '{print $2}')
187         echo "cinc_container_image=${CINC_IMAGE}" >> "$GITHUB_OUTPUT"
188         echo "cinc_container_version=${CINC_VERSION}" >> "$GITHUB_OUTPUT"
189         echo "cinc_container_ref=${CINC_IMAGE}:${CINC_VERSION}" >> "$GITHUB_OUTPUT"
190     - name: Login to GitHub Container Registry
191       uses: docker/login-action@v4
192       with:
193         registry: ghcr.io
194         username: ${{ github.actor }}
195         password: ${{ secrets.GITHUB_TOKEN }}
196     - name: Cache cinc container image
197       id: cache-cinc
198       uses: actions/cache@v6
199       with:
200         path: /tmp/cinc-image.tar
201         key: docker-cinc-${{ steps.cinc-image.outputs.cinc_container_version }}-${{ runner.arch }}
202     - name: Pull and save cinc container image
203       if: steps.cache-cinc.outputs.cache-hit != 'true'
204       run: |
205         docker pull "${{ steps.cinc-image.outputs.cinc_container_ref }}"
206         docker save "${{ steps.cinc-image.outputs.cinc_container_ref }}" -o /tmp/cinc-image.tar
207     - name: Load cinc container image from cache
208       if: steps.cache-cinc.outputs.cache-hit == 'true'
209       run: docker load -i /tmp/cinc-image.tar
210     - name: Setup ruby
211       uses: ruby/setup-ruby@v1
212       with:
213         bundler-cache: true
214     - name: Run kitchen test ${{ matrix.suite }}-${{ matrix.os }}
215       run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }}
216     - name: Gather journal output
217       run: |
218         bundle exec kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "journalctl --since=yesterday"
219         bundle exec kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "networkctl status --all"
220         bundle exec kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "resolvectl status" || true
221       if: ${{ failure() }}