]> git.openstreetmap.org Git - chef.git/blob - .github/workflows/test-kitchen.yml
Merge remote-tracking branch 'github/pull/691'
[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-22.04
16     permissions:
17       packages: read
18     strategy:
19       matrix:
20         suite:
21           - accounts
22           - apache
23           - apt
24           - apt-repository
25           - backup
26           - bind
27           - blog
28           - blogs
29           - chef
30           - civicrm
31           - clamav
32           - community
33           - db-backup
34           - db-base
35           - db-master
36           - db-slave
37           - devices
38           - dhcpd
39           - dmca
40           - dns
41           - docker
42           - elasticsearch
43           - exim
44           - fail2ban
45           - foundation-board
46           - foundation-dwg
47           - foundation-mastodon
48           - foundation-mwg
49           - foundation-owg
50           - foundation-welcome
51           - foundation-wiki
52           - ftp
53           - geodns
54           - geoipupdate
55           - git
56           - git-server
57           - git-web
58           - gps-tile
59           - hardware
60           - hot
61           - ideditor
62           - irc
63           - kibana
64           - letsencrypt
65           - logstash
66           - logstash-forwarder
67           - mail
68           - mailman
69           - matomo
70           - memcached
71           - mysql
72           - networking
73           - nginx
74           - nodejs
75           - nominatim
76           - ntp
77           - openssh
78           - osmosis
79           - osqa
80           - otrs
81           - overpass
82           - passenger
83           - php
84           - php-apache
85           - php-fpm
86           - planet
87           - planet-aws
88           - planet-current
89           - planet-dump
90           - planet-notes
91           - planet-replication
92           - postgresql
93           - prometheus
94           - prometheus-server
95           - python
96           - rsyncd
97           - serverinfo
98           - snmpd
99           - spamassassin
100           - ssl
101           - stateofthemap-container
102           - stateofthemap-wordpress
103           - subversion
104           - supybot
105           - switch2osm
106           - sysctl
107           - sysfs
108           - taginfo
109           - tile
110           - tilelog
111           - tools
112           - trac
113           - web-cgimap
114           - web-frontend
115           - web-rails
116           - wordpress
117           - wiki
118         os:
119           - ubuntu-2204
120         include:
121           - os: ubuntu-2004
122             suite: mailman
123           - os: ubuntu-2004
124             suite: osqa
125           - os: debian-12
126             suite: apt-repository
127           - os: debian-12
128             suite: dns
129           - os: debian-12
130             suite: git-server
131           - os: debian-12
132             suite: git-web
133           - os: debian-12
134             suite: imagery-tiler
135           - os: debian-12
136             suite: letsencrypt
137           - os: debian-12
138             suite: otrs
139           - os: debian-12
140             suite: serverinfo
141           - os: debian-12
142             suite: supybot
143           - os: debian-12
144             suite: web-cgimap
145           - os: debian-12
146             suite: web-frontend
147           - os: debian-12
148             suite: web-rails
149         exclude:
150           - suite: apt-repository
151             os: ubuntu-2204
152           - suite: dns
153             os: ubuntu-2204
154           - suite: git-server
155             os: ubuntu-2204
156           - suite: git-web
157             os: ubuntu-2204
158           - suite: mailman
159             os: ubuntu-2204
160           - suite: letsencrypt
161             os: ubuntu-2204
162           - suite: osqa
163             os: ubuntu-2204
164           - suite: otrs
165             os: ubuntu-2204
166           - suite: serverinfo
167             os: ubuntu-2204
168           - suite: supybot
169             os: ubuntu-2204
170           - suite: web-cgimap
171             os: ubuntu-2204
172           - suite: web-frontend
173             os: ubuntu-2204
174           - suite: web-rails
175             os: ubuntu-2204
176       fail-fast: false
177     steps:
178     - name: Login to GitHub Container Registry
179       uses: docker/login-action@v3
180       with:
181         registry: ghcr.io
182         username: ${{ github.actor }}
183         password: ${{ secrets.GITHUB_TOKEN }}
184     - name: Login to Docker Hub
185       uses: docker/login-action@v3
186       with:
187         username: ${{ secrets.DOCKERHUB_USERNAME }}
188         password: ${{ secrets.DOCKERHUB_TOKEN }}
189       if: github.repository == 'openstreetmap/chef' && github.event_name != 'pull_request'
190     - name: Check out code
191       uses: actions/checkout@v4
192     - name: Setup ruby
193       uses: ruby/setup-ruby@v1
194       with:
195         ruby-version: 3.1
196         bundler-cache: true
197     - name: Run kitchen test ${{ matrix.suite }}-${{ matrix.os }}
198       run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }}
199     - name: Gather journal output
200       run: |
201         bundle exec kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "journalctl --since=yesterday"
202         bundle exec kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "networkctl status --all"
203         bundle exec kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "resolvectl status" || true
204       if: ${{ failure() }}