Skip to content

Commit 91385fa

Browse files
authored
Merge pull request #1359 from roots/add-integration-test
Add integration test
2 parents 56582d4 + 1b900f3 commit 91385fa

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/integration.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- run: mkdir $HOME/.ssh
14+
- name: Remove and cleanup mysql
15+
run: |
16+
sudo apt-get remove --purge mysql*
17+
sudo apt-get autoremove
18+
sudo apt-get autoclean
19+
sudo rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld ~/.mysql_history
20+
- uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 0
23+
- uses: actions/setup-python@v2
24+
with:
25+
python-version: '3.9'
26+
- uses: roots/setup-trellis-cli@v1
27+
with:
28+
ansible-vault-password: 'fake'
29+
auto-init: false
30+
galaxy-install: false
31+
trellis-directory: '.'
32+
- name: Create new Trellis project
33+
run: trellis new --name example.com --host www.example.com --trellis-version ${{ github.sha }} ./example.com
34+
- name: Update configs
35+
run: |
36+
sudo echo "127.0.0.1 www.example.com example.com" | sudo tee -a /etc/hosts
37+
rm hosts/production && echo -e "[production]\nlocalhost ansible_connection=local\n[web]\nlocalhost ansible_connection=local\n" > hosts/production
38+
sed --in-place '/repo_subtree_path: site/d' group_vars/production/wordpress_sites.yml
39+
working-directory: example.com/trellis
40+
- name: Provision
41+
run: trellis provision --extra-vars web_user=runner production
42+
working-directory: example.com
43+
- name: Deploy
44+
run: trellis deploy --extra-vars "web_user=runner project_git_repo=https://github.com/roots/bedrock.git" production
45+
working-directory: example.com
46+
- name: Install WordPress
47+
run: |
48+
wp core install --url="http://example.com" --title="Example.com" --admin_user="admin" --admin_password="password" --admin_email="admin@example.com"
49+
working-directory: /srv/www/example.com/current
50+
- name: Verify install
51+
run: curl -s http://www.example.com | grep "<title>Example"

0 commit comments

Comments
 (0)