]> git.openstreetmap.org Git - chef.git/commitdiff
Switch to using github actions for CI tasks
authorTom Hughes <tom@compton.nu>
Thu, 21 Nov 2019 10:00:42 +0000 (10:00 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 21 Feb 2020 00:09:27 +0000 (00:09 +0000)
.github/workflows/cookstyle.yml [new file with mode: 0644]
.github/workflows/test-kitchen.yml [new file with mode: 0644]
.travis.yml [deleted file]
README.md
cookbooks/networking/recipes/default.rb

diff --git a/.github/workflows/cookstyle.yml b/.github/workflows/cookstyle.yml
new file mode 100644 (file)
index 0000000..f77ac78
--- /dev/null
@@ -0,0 +1,28 @@
+name: Coookstyle
+on:
+  - push
+  - pull_request
+jobs:
+  cookstyle:
+    name: Cookstyle
+    runs-on: ubuntu-latest
+    steps:
+    - name: Check out code
+      uses: actions/checkout@v1
+      with:
+        fetch-depth: 1
+    - name: Setup ruby
+      uses: actions/setup-ruby@v1
+    - name: Cache gems
+      uses: actions/cache@v1
+      with:
+        path: vendor/bundle
+        key: bundle-${{ runner.OS }}-${{ hashFiles('Gemfile.lock') }}
+        restore-keys: |
+          bundle-${{ runner.OS }}-
+    - name: Install gems
+      run: |
+        gem install bundler --version "~> 1.17"
+        bundle install --jobs 4 --retry 3 --deployment
+    - name: Run cookstyle
+      run: bundle exec cookstyle --format fuubar
diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml
new file mode 100644 (file)
index 0000000..16babd4
--- /dev/null
@@ -0,0 +1,99 @@
+name: Test Kitchen
+on:
+  - push
+  - pull_request
+jobs:
+  kitchen:
+    name: Test Kitchen
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        suite:
+          - accounts
+          - apache
+          - apt
+          - bind
+          - blog
+          - blogs
+          - civicrm
+          - clamav
+          - devices
+          - dhcpd
+          - dmca
+          - donate
+          - exim
+          - fail2ban
+          - forum
+          - ftp
+          - geodns
+          - geoipupdate
+          - gps-tile
+          - hardware
+          - incron
+          - letsencrypt
+          - mailman
+          - memcached
+          - munin
+          - munin-plugins
+          - munin-server
+          - mysql
+          - networking
+          - nginx
+          - nodejs
+          - ntp
+          - openssh
+          - osmosis
+          - osqa
+          - otrs
+          - passenger
+          - piwik
+          - planet
+          - planet-dump
+          - planet-notes
+          - planet-replication
+          - postgresql
+          - python
+          - rsyncd
+          - serverinfo
+          - spamassassin
+          - squid
+          - stateofthemap
+          - subversion
+          - supybot
+          - switch2osm
+          - taginfo
+          - tile
+          - tilecache
+          - tools
+          - trac
+          - web-backend
+          - web-cgimap
+          - web-frontend
+          - web-rails
+        os:
+          - ubuntu-1804
+      fail-fast: false
+    steps:
+    - name: Check out code
+      uses: actions/checkout@v1
+      with:
+        fetch-depth: 1
+    - name: Setup ruby
+      uses: actions/setup-ruby@v1
+    - name: Cache gems
+      uses: actions/cache@v1
+      with:
+        path: vendor/bundle
+        key: bundle-${{ runner.OS }}-${{ hashFiles('Gemfile.lock') }}
+        restore-keys: |
+          bundle-${{ runner.OS }}-
+    - name: Disable apparmor for mysqld
+      run: |
+        sudo apt-get install apparmor-utils
+        sudo aa-disable /usr/sbin/mysqld
+    - name: Install gems
+      run: |
+        gem install bundler --version "~> 1.17"
+        bundle install --jobs 4 --retry 3 --deployment
+    - name: Run kitchen test ${{ matrix.suite }}-${{ matrix.os }}
+      run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index eac9850..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-language: ruby
-os: linux
-dist: bionic
-cache: bundler
-services:
-  - docker
-jobs:
-  include:
-    - name: "Cookstyle"
-      script:
-        - bundle exec cookstyle -f fuubar
-    - name: "Test Kitchen (accounts)"
-      script:
-        - bundle exec kitchen test accounts-ubuntu-1804
-    - name: "Test Kitchen (apache)"
-      script:
-        - bundle exec kitchen test apache-ubuntu-1804
-    - name: "Test Kitchen (apt)"
-      script:
-        - bundle exec kitchen test apt-ubuntu-1804
-    - name: "Test Kitchen (bind)"
-      script:
-        - bundle exec kitchen test bind-ubuntu-1804
-    - name: "Test Kitchen (blogs)"
-      script:
-        - bundle exec kitchen test blogs-ubuntu-1804
-    - name: "Test Kitchen (civicrm)"
-      script:
-        - bundle exec kitchen test civicrm-ubuntu-1804
-    - name: "Test Kitchen (clamav)"
-      script:
-        - bundle exec kitchen test clamav-ubuntu-1804
-    - name: "Test Kitchen (devices)"
-      script:
-        - bundle exec kitchen test devices-ubuntu-1804
-    - name: "Test Kitchen (dhcpd)"
-      script:
-        - bundle exec kitchen test dhcpd-ubuntu-1804
-    - name: "Test Kitchen (dmca)"
-      script:
-        - bundle exec kitchen test dmca-ubuntu-1804
-    - name: "Test Kitchen (donate)"
-      script:
-        - bundle exec kitchen test donate-ubuntu-1804
-    - name: "Test Kitchen (exim)"
-      script:
-        - bundle exec kitchen test exim-ubuntu-1804
-    - name: "Test Kitchen (fail2ban)"
-      script:
-        - bundle exec kitchen test fail2ban-ubuntu-1804
-    - name: "Test Kitchen (forum)"
-      script:
-        - bundle exec kitchen test forum-ubuntu-1804
-    - name: "Test Kitchen (ftp)"
-      script:
-        - bundle exec kitchen test ftp-ubuntu-1804
-    - name: "Test Kitchen (geodns)"
-      script:
-        - bundle exec kitchen test geodns-ubuntu-1804
-    - name: "Test Kitchen (geoipupdate)"
-      script:
-        - bundle exec kitchen test geoipupdate-ubuntu-1804
-    - name: "Test Kitchen (gps-tile)"
-      script:
-        - bundle exec kitchen test gps-tile-ubuntu-1804
-    - name: "Test Kitchen (hardare)"
-      script:
-        - bundle exec kitchen test hardware-ubuntu-1804
-    - name: "Test Kitchen (incron)"
-      script:
-        - bundle exec kitchen test incron-ubuntu-1804
-    - name: "Test Kitchen (letsencrypt)"
-      script:
-        - bundle exec kitchen test letsencrypt-ubuntu-1804
-    - name: "Test Kitchen (mailman)"
-      script:
-        - bundle exec kitchen test mailman-ubuntu-1804
-    - name: "Test Kitchen (memcached)"
-      script:
-        - bundle exec kitchen test memcached-ubuntu-1804
-    - name: "Test Kitchen (munin)"
-      script:
-        - bundle exec kitchen test munin-ubuntu-1804
-    - name: "Test Kitchen (munin::plugins)"
-      script:
-        - bundle exec kitchen test munin-plugins-ubuntu-1804
-    - name: "Test Kitchen (munin::server)"
-      script:
-        - bundle exec kitchen test munin-server-ubuntu-1804
-    - name: "Test Kitchen (mysql)"
-      script:
-        - bundle exec kitchen test mysql-ubuntu-1804
-    - name: "Test Kitchen (networking)"
-      script:
-        - bundle exec kitchen test networking-ubuntu-1804
-    - name: "Test Kitchen (nginx)"
-      script:
-        - bundle exec kitchen test nginx-ubuntu-1804
-    - name: "Test Kitchen (nodejs)"
-      script:
-        - bundle exec kitchen test nodejs-ubuntu-1804
-    - name: "Test Kitchen (ntp)"
-      script:
-        - bundle exec kitchen test ntp-ubuntu-1804
-    - name: "Test Kitchen (openssh)"
-      script:
-        - bundle exec kitchen test openssh-ubuntu-1804
-    - name: "Test Kitchen (osmosis)"
-      script:
-        - bundle exec kitchen test osmosis-ubuntu-1804
-    - name: "Test Kitchen (osqa)"
-      script:
-        - bundle exec kitchen test osqa-ubuntu-1804
-      attributes:
-        osqa:
-          sites:
-            - name: help.example.com
-    - name: "Test Kitchen (otrs)"
-      script:
-        - bundle exec kitchen test otrs-ubuntu-1804
-    - name: "Test Kitchen (passenger)"
-      script:
-        - bundle exec kitchen test passenger-ubuntu-1804
-    - name: "Test Kitchen (piwik)"
-      script:
-        - bundle exec kitchen test piwik-ubuntu-1804
-    - name: "Test Kitchen (planet)"
-      script:
-        - bundle exec kitchen test planet-ubuntu-1804
-    - name: "Test Kitchen (planet::dump)"
-      script:
-        - bundle exec kitchen test planet-dump-ubuntu-1804
-    - name: "Test Kitchen (planet::notes)"
-      script:
-        - bundle exec kitchen test planet-notes-ubuntu-1804
-    - name: "Test Kitchen (planet::replication)"
-      script:
-        - bundle exec kitchen test planet-replication-ubuntu-1804
-    - name: "Test Kitchen (postgresql)"
-      script:
-        - bundle exec kitchen test postgresql-ubuntu-1804
-    - name: "Test Kitchen (python)"
-      script:
-        - bundle exec kitchen test python-ubuntu-1804
-    - name: "Test Kitchen (rsyncd)"
-      script:
-        - bundle exec kitchen test rsyncd-ubuntu-1804
-    - name: "Test Kitchen (serverinfo)"
-      script:
-        - bundle exec kitchen test serverinfo-ubuntu-1804
-    - name: "Test Kitchen (spamassassin)"
-      script:
-        - bundle exec kitchen test spamassassin-ubuntu-1804
-    - name: "Test Kitchen (squid)"
-      script:
-        - bundle exec kitchen test squid-ubuntu-1804
-    - name: "Test Kitchen (stateofthemap)"
-      script:
-        - bundle exec kitchen test stateofthemap-ubuntu-1804
-    - name: "Test Kitchen (subversion)"
-      script:
-        - bundle exec kitchen test subversion-ubuntu-1804
-    - name: "Test Kitchen (supybot)"
-      script:
-        - bundle exec kitchen test supybot-ubuntu-1804
-    - name: "Test Kitchen (switch2osm)"
-      script:
-        - bundle exec kitchen test switch2osm-ubuntu-1804
-    - name: "Test Kitchen (taginfo)"
-      script:
-        - bundle exec kitchen test taginfo-ubuntu-1804
-    - name: "Test Kitchen (tile)"
-      script:
-        - bundle exec kitchen test tile-ubuntu-1804
-    - name: "Test Kitchen (tilecache)"
-      script:
-        - bundle exec kitchen test tilecache-ubuntu-1804
-    - name: "Test Kitchen (tools)"
-      script:
-        - bundle exec kitchen test tools-ubuntu-1804
-    - name: "Test Kitchen (trac)"
-      script:
-        - bundle exec kitchen test trac-ubuntu-1804
-    - name: "Test Kitchen (web::backend)"
-      script:
-        - bundle exec kitchen test web-backend-ubuntu-1804
-    - name: "Test Kitchen (web::cgimap)"
-      script:
-        - bundle exec kitchen test web-cgimap-ubuntu-1804
-    - name: "Test Kitchen (web::frontend)"
-      script:
-        - bundle exec kitchen test web-frontend-ubuntu-1804
-    - name: "Test Kitchen (web::rails)"
-      script:
-        - bundle exec kitchen test web-rails-ubuntu-1804
index 8707c7b461c18a3d46329c097cf8d7a692fd4f26..2273b629cea33b0c4cf4253ba178e50f1ad35b24 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 # OpenStreetMap chef cookbooks
 
-[![Build Status](https://travis-ci.org/openstreetmap/chef.svg?branch=master)](https://travis-ci.org/openstreetmap/chef)
+[![Coookstyle](https://github.com/tomhughes/openstreetmap-chef/workflows/Coookstyle/badge.svg)](https://github.com/tomhughes/openstreetmap-chef/actions?query=workflow%3ACoookstyle)
+[![Test Kitchen](https://github.com/tomhughes/openstreetmap-chef/workflows/Test%20Kitchen/badge.svg)](https://github.com/tomhughes/openstreetmap-chef/actions?query=workflow%3A%22Test+Kitchen%22)
 
 This repository manages the configuration of all the servers run by the
 OpenStreetMap Foundation's Operations Working Group. We use
index 013037959c449abc7baed6b7817d05da117ba852..89e8198e223ba0545b479afaa87d50ec440666d6 100644 (file)
@@ -195,6 +195,7 @@ template "/etc/hosts" do
   owner "root"
   group "root"
   mode 0o644
+  not_if { ENV["TEST_KITCHEN"] }
 end
 
 service "systemd-resolved" do