Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 3be3868

Browse files
authored
Merge pull request #2113 from geerlingguy/2109-github-actions-molecule
Migrate from shell script and Travis CI to Molecule and GitHub Actions
2 parents de17b47 + da0c3d2 commit 3be3868

40 files changed

+602
-401
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# These are supported funding model platforms
2-
2+
---
33
github: geerlingguy
44
patreon: geerlingguy

.github/workflows/ci.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
name: CI
3+
'on':
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
schedule:
9+
- cron: "20 3 * * 0"
10+
11+
jobs:
12+
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out the codebase.
18+
uses: actions/checkout@v2
19+
20+
- name: Set up Python 3.
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: '3.x'
24+
25+
- name: Set up Ruby.
26+
uses: actions/setup-ruby@v1
27+
with:
28+
ruby-version: 2.6
29+
30+
- name: Install test dependencies.
31+
run: |
32+
pip3 install yamllint
33+
gem install rubocop
34+
35+
- name: Lint code.
36+
run: |
37+
yamllint .
38+
rubocop ./Vagrantfile ./lib/drupalvm \
39+
--except Metrics/LineLength,Security/Eval,Style/MutableConstant,Metrics/BlockLength,Metrics/MethodLength,Style/ConditionalAssignment,Style/IfUnlessModifier,Style/CaseLikeIf
40+
41+
molecule:
42+
name: Molecule
43+
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
include:
47+
# Defaults.
48+
- distro: ubuntu1804
49+
playbook: converge.yml
50+
- distro: debian10
51+
playbook: converge.yml
52+
- distro: centos8
53+
playbook: converge.yml
54+
55+
# TODO: Add PHP 7.4 test.
56+
# local_config: tests/ubuntu1804-php74.config.yml
57+
# test_extras: false
58+
# - distro: ubuntu1804
59+
# playbook: TODO
60+
61+
# TODO: Add Postgresql test.
62+
# local_config: tests/ubuntu1804-postgresql.config.yml
63+
# config_dir: /var/www/drupalvm/config
64+
# test_extras: false
65+
# - distro: ubunt1804
66+
# playbook: TODO
67+
68+
steps:
69+
- name: Check out the codebase.
70+
uses: actions/checkout@v2
71+
72+
- name: Set up Python 3.
73+
uses: actions/setup-python@v2
74+
with:
75+
python-version: '3.x'
76+
77+
- name: Install test dependencies.
78+
run: pip3 install ansible molecule[docker] docker
79+
80+
# See: https://github.com/geerlingguy/ansible-role-mysql/issues/422
81+
- name: Disable AppArmor on Debian.
82+
run: |
83+
set -x
84+
sudo apt-get install apparmor-profiles
85+
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
86+
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
87+
if: ${{ startsWith(matrix.distro, 'debian') }}
88+
89+
- name: Copy test scaffold files into place.
90+
run: |
91+
cp example.drupal.make.yml drupal.make.yml
92+
cp example.drupal.composer.json drupal.composer.json
93+
94+
- name: Run Molecule tests.
95+
run: molecule test
96+
env:
97+
PY_COLORS: '1'
98+
ANSIBLE_FORCE_COLOR: '1'
99+
MOLECULE_DISTRO: ${{ matrix.distro }}

.travis.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.yamllint

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
line-length:
6+
max: 200
7+
level: warning
8+
truthy:
9+
allowed-values: ['true', 'false', 'yes', 'no']
10+
braces:
11+
min-spaces-inside: 1
12+
max-spaces-inside: 1
13+
min-spaces-inside-empty: -1
14+
max-spaces-inside-empty: -1
15+
16+
ignore: |
17+
*/stale.yml
18+
provisioning/roles/

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![Drupal VM Logo](https://raw.githubusercontent.com/geerlingguy/drupal-vm/master/docs/images/drupal-vm-logo.png)
22

3-
[![Build Status](https://travis-ci.com/geerlingguy/drupal-vm.svg?branch=master)](https://travis-ci.com/geerlingguy/drupal-vm) [![Documentation Status](https://readthedocs.org/projects/drupal-vm/badge/?version=latest)](http://docs.drupalvm.com) [![Packagist](https://img.shields.io/packagist/v/geerlingguy/drupal-vm.svg)](https://packagist.org/packages/geerlingguy/drupal-vm) [![Docker Automated build](https://img.shields.io/docker/automated/geerlingguy/drupal-vm.svg?maxAge=2592000)](https://hub.docker.com/r/geerlingguy/drupal-vm/) [![](https://images.microbadger.com/badges/image/geerlingguy/drupal-vm.svg)](https://microbadger.com/images/geerlingguy/drupal-vm "Get your own image badge on microbadger.com") [![irc://irc.freenode.net/drupal-vm](https://img.shields.io/badge/irc.freenode.net-%23drupal--vm-brightgreen.svg)](https://riot.im/app/#/room/#drupal-vm:matrix.org)
3+
[![CI](https://github.com/geerlingguy/drupal-vm/workflows/CI/badge.svg?event=push)](https://github.com/geerlingguy/drupal-vm/actions?query=workflow%3ACI) [![Documentation Status](https://readthedocs.org/projects/drupal-vm/badge/?version=latest)](http://docs.drupalvm.com) [![Packagist](https://img.shields.io/packagist/v/geerlingguy/drupal-vm.svg)](https://packagist.org/packages/geerlingguy/drupal-vm) [![Docker Automated build](https://img.shields.io/docker/automated/geerlingguy/drupal-vm.svg?maxAge=2592000)](https://hub.docker.com/r/geerlingguy/drupal-vm/) [![](https://images.microbadger.com/badges/image/geerlingguy/drupal-vm.svg)](https://microbadger.com/images/geerlingguy/drupal-vm "Get your own image badge on microbadger.com") [![irc://irc.freenode.net/drupal-vm](https://img.shields.io/badge/irc.freenode.net-%23drupal--vm-brightgreen.svg)](https://riot.im/app/#/room/#drupal-vm:matrix.org)
44

55
[Drupal VM](https://www.drupalvm.com/) is a VM for Drupal, built with Ansible.
66

@@ -168,14 +168,13 @@ Drupal VM runs on almost any modern computer that can run VirtualBox and Vagrant
168168

169169
## Tests
170170

171-
To run basic integration tests using Docker:
171+
To run basic integration tests using Docker and Molecule:
172172

173173
1. [Install Docker](https://docs.docker.com/engine/installation/).
174+
2. Install Molecule: `pip3 install ansible molecule[docker]`
174175
2. In this project directory, run: `composer run-tests`
175176

176-
> Note: If you're on a Mac, you need to use [Docker's Edge release](https://docs.docker.com/docker-for-mac/install/#download-docker-for-mac), at least until [this issue](https://github.com/docker/for-mac/issues/77) is resolved.
177-
178-
The project's automated tests are run via Travis CI, and the more comprehensive test suite covers multiple Linux distributions and many different Drupal VM use cases and deployment techniques.
177+
The project's automated tests are run via GitHub Actions, and the more comprehensive test suite covers multiple Linux distributions and many different Drupal VM use cases and deployment techniques.
179178

180179
## License
181180

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"process-timeout": 1800
2626
},
2727
"scripts": {
28-
"run-tests": "./tests/run-tests.sh",
28+
"run-tests": "molecule test",
2929
"docker-bake": "./provisioning/docker/bake.sh",
3030
"docker-save-image": "./provisioning/docker/save-image.sh",
3131
"docker-load-image": "./provisioning/docker/load-image.sh"

default.config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ drupal_major_version: 9
9595
drupal_domain: "{{ vagrant_hostname }}"
9696
drupal_site_name: "Drupal"
9797
drupal_install_profile: standard
98-
drupal_enable_modules: [ 'devel' ]
98+
drupal_enable_modules: ['devel']
9999
drupal_account_name: admin
100100
drupal_account_pass: admin
101101

@@ -285,7 +285,7 @@ composer_global_packages: []
285285
# reference the directory where your `config.yml` is.
286286
pre_provision_scripts: []
287287
post_provision_scripts: []
288-
# - "{{ playbook_dir }}/../examples/scripts/configure-solr.sh"
288+
# - "{{ playbook_dir }}/../examples/scripts/configure-solr.sh"
289289

290290
# MySQL Configuration.
291291
mysql_root_password: root

example.docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
version: "3"
23

34
services:

mkdocs.yml

Lines changed: 58 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
site_name: Drupal VM Documentation
23

34
repo_url: https://github.com/geerlingguy/drupal-vm
@@ -9,69 +10,69 @@ extra_javascript:
910

1011
markdown_extensions:
1112
- toc:
12-
permalink: True
13+
permalink: true
1314

1415
pages:
1516
- Home: 'index.md'
1617
- Getting Started:
17-
- Installation:
18-
- 'macOS': 'getting-started/installation-macos.md'
19-
- 'Windows': 'getting-started/installation-windows.md'
20-
- 'Linux': 'getting-started/installation-linux.md'
21-
- 'Configuring Drupal VM': 'getting-started/configure-drupalvm.md'
22-
- 'Syncing Folders': 'getting-started/syncing-folders.md'
18+
- Installation:
19+
- 'macOS': 'getting-started/installation-macos.md'
20+
- 'Windows': 'getting-started/installation-windows.md'
21+
- 'Linux': 'getting-started/installation-linux.md'
22+
- 'Configuring Drupal VM': 'getting-started/configure-drupalvm.md'
23+
- 'Syncing Folders': 'getting-started/syncing-folders.md'
2324
- Building your codebase:
24-
- 'Using a local Drupal codebase': 'deployment/local-codebase.md'
25-
- 'Using a composer package': 'deployment/composer-package.md'
26-
- 'Using composer.json': 'deployment/composer.md'
27-
- 'Using a Drush Make file': 'deployment/drush-make.md'
28-
- 'Drupal VM as a Composer Dependency': 'deployment/composer-dependency.md'
29-
- 'Deploying Drupal via Git': 'deployment/git.md'
25+
- 'Using a local Drupal codebase': 'deployment/local-codebase.md'
26+
- 'Using a composer package': 'deployment/composer-package.md'
27+
- 'Using composer.json': 'deployment/composer.md'
28+
- 'Using a Drush Make file': 'deployment/drush-make.md'
29+
- 'Drupal VM as a Composer Dependency': 'deployment/composer-dependency.md'
30+
- 'Deploying Drupal via Git': 'deployment/git.md'
3031
- Basic configurations:
31-
- 'Using different base OSes': 'configurations/base-os.md'
32-
- 'Using a different PHP version': 'configurations/php.md'
33-
- Webservers:
34-
- 'Apache': 'configurations/webservers-apache.md'
35-
- 'Nginx': 'configurations/webservers-nginx.md'
36-
- Databases:
37-
- 'Connect to the MySQL Database': 'configurations/databases-mysql.md'
38-
- 'Use MariaDB instead of MySQL': 'configurations/databases-mariadb.md'
39-
- 'Use PostgreSQL instead of MySQL': 'configurations/databases-postgresql.md'
32+
- 'Using different base OSes': 'configurations/base-os.md'
33+
- 'Using a different PHP version': 'configurations/php.md'
34+
- Webservers:
35+
- 'Apache': 'configurations/webservers-apache.md'
36+
- 'Nginx': 'configurations/webservers-nginx.md'
37+
- Databases:
38+
- 'Connect to the MySQL Database': 'configurations/databases-mysql.md'
39+
- 'Use MariaDB instead of MySQL': 'configurations/databases-mariadb.md'
40+
- 'Use PostgreSQL instead of MySQL': 'configurations/databases-postgresql.md'
4041
- Installed extras:
41-
- 'adminer (Database UI)': 'extras/adminer.md'
42-
- 'blackfire (Profiling tool)': 'extras/blackfire.md'
43-
- 'drupalconsole (Drupal CLI)': 'extras/drupal-console.md'
44-
- 'drush (Drupal CLI)': 'extras/drush.md'
45-
- 'elasticsearch (Search engine)': 'extras/elasticsearch.md'
46-
- 'java': 'extras/java.md'
47-
- 'mailhog (Mail catcher)': 'extras/mailhog.md'
48-
- 'memcached (In-memory cache)': 'extras/memcached.md'
49-
- 'newrelic (Performance monitoring)': 'extras/newrelic.md'
50-
- 'nodejs': 'extras/nodejs.md'
51-
- 'pimpmylog (Log viewer)': 'extras/pimpmylog.md'
52-
- 'redis (In-memory database)': 'extras/redis.md'
53-
- 'ruby': 'extras/ruby.md'
54-
- 'selenium (BDD with Behat)': 'extras/selenium.md'
55-
- 'solr (Search engine)': 'extras/solr.md'
56-
- 'tideways (Profiling tool)': 'extras/tideways.md'
57-
- 'upload-progress': 'extras/upload-progress.md'
58-
- 'varnish (Caching reverse proxy)': 'extras/varnish.md'
59-
- 'xdebug (Debugging tool)': 'extras/xdebug.md'
60-
- 'xhprof (Profiling tool)': 'extras/xhprof.md'
42+
- 'adminer (Database UI)': 'extras/adminer.md'
43+
- 'blackfire (Profiling tool)': 'extras/blackfire.md'
44+
- 'drupalconsole (Drupal CLI)': 'extras/drupal-console.md'
45+
- 'drush (Drupal CLI)': 'extras/drush.md'
46+
- 'elasticsearch (Search engine)': 'extras/elasticsearch.md'
47+
- 'java': 'extras/java.md'
48+
- 'mailhog (Mail catcher)': 'extras/mailhog.md'
49+
- 'memcached (In-memory cache)': 'extras/memcached.md'
50+
- 'newrelic (Performance monitoring)': 'extras/newrelic.md'
51+
- 'nodejs': 'extras/nodejs.md'
52+
- 'pimpmylog (Log viewer)': 'extras/pimpmylog.md'
53+
- 'redis (In-memory database)': 'extras/redis.md'
54+
- 'ruby': 'extras/ruby.md'
55+
- 'selenium (BDD with Behat)': 'extras/selenium.md'
56+
- 'solr (Search engine)': 'extras/solr.md'
57+
- 'tideways (Profiling tool)': 'extras/tideways.md'
58+
- 'upload-progress': 'extras/upload-progress.md'
59+
- 'varnish (Caching reverse proxy)': 'extras/varnish.md'
60+
- 'xdebug (Debugging tool)': 'extras/xdebug.md'
61+
- 'xhprof (Profiling tool)': 'extras/xhprof.md'
6162
- Extending Drupal VM:
62-
- 'Adding Vagrant plugins Vagrantfile.local': 'extending/vagrantfile.md'
63-
- 'Passing on CLI arguments to ansible': 'extending/ansible-args.md'
64-
- 'Pre- and Post-Provision Scripts': 'extending/scripts.md'
63+
- 'Adding Vagrant plugins Vagrantfile.local': 'extending/vagrantfile.md'
64+
- 'Passing on CLI arguments to ansible': 'extending/ansible-args.md'
65+
- 'Pre- and Post-Provision Scripts': 'extending/scripts.md'
6566
- Other Information:
66-
- 'Networking Notes': 'other/networking.md'
67-
- 'Vagrant LXC provider': 'other/vagrant-lxc.md'
68-
- 'Improving Performance': 'other/performance.md'
69-
- 'Docker': 'other/docker.md'
70-
- 'Custom Vagrant Base Box': 'other/custom-base-box.md'
71-
- 'BigPipe with Drupal VM': 'other/bigpipe.md'
72-
- 'Drupal multisite': 'deployment/multisite.md'
73-
- 'Drupal 6 Notes': 'other/drupal-6.md'
74-
- 'Drupal VM Management Tools': 'other/management-tools.md'
75-
- 'Emulating Acquia Cloud environment': 'other/acquia.md'
76-
- 'Deploying to a production environment': 'other/production.md'
77-
- 'Wordpress or other applications': 'other/wordpress-other-applications.md'
67+
- 'Networking Notes': 'other/networking.md'
68+
- 'Vagrant LXC provider': 'other/vagrant-lxc.md'
69+
- 'Improving Performance': 'other/performance.md'
70+
- 'Docker': 'other/docker.md'
71+
- 'Custom Vagrant Base Box': 'other/custom-base-box.md'
72+
- 'BigPipe with Drupal VM': 'other/bigpipe.md'
73+
- 'Drupal multisite': 'deployment/multisite.md'
74+
- 'Drupal 6 Notes': 'other/drupal-6.md'
75+
- 'Drupal VM Management Tools': 'other/management-tools.md'
76+
- 'Emulating Acquia Cloud environment': 'other/acquia.md'
77+
- 'Deploying to a production environment': 'other/production.md'
78+
- 'Wordpress or other applications': 'other/wordpress-other-applications.md'

0 commit comments

Comments
 (0)