Skip to content

Commit

Permalink
Merge pull request #1359 from roots/add-integration-test
Browse files Browse the repository at this point in the history
Add integration test
  • Loading branch information
swalkinshaw authored Feb 15, 2022
2 parents 56582d4 + 1b900f3 commit 91385fa
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Integration

on:
push:
branches:
- master
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
steps:
- run: mkdir $HOME/.ssh
- name: Remove and cleanup mysql
run: |
sudo apt-get remove --purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
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
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- uses: roots/setup-trellis-cli@v1
with:
ansible-vault-password: 'fake'
auto-init: false
galaxy-install: false
trellis-directory: '.'
- name: Create new Trellis project
run: trellis new --name example.com --host www.example.com --trellis-version ${{ github.sha }} ./example.com
- name: Update configs
run: |
sudo echo "127.0.0.1 www.example.com example.com" | sudo tee -a /etc/hosts
rm hosts/production && echo -e "[production]\nlocalhost ansible_connection=local\n[web]\nlocalhost ansible_connection=local\n" > hosts/production
sed --in-place '/repo_subtree_path: site/d' group_vars/production/wordpress_sites.yml
working-directory: example.com/trellis
- name: Provision
run: trellis provision --extra-vars web_user=runner production
working-directory: example.com
- name: Deploy
run: trellis deploy --extra-vars "web_user=runner project_git_repo=/~https://github.com/roots/bedrock.git" production
working-directory: example.com
- name: Install WordPress
run: |
wp core install --url="http://example.com" --title="Example.com" --admin_user="admin" --admin_password="password" --admin_email="admin@example.com"
working-directory: /srv/www/example.com/current
- name: Verify install
run: curl -s http://www.example.com | grep "<title>Example"

0 comments on commit 91385fa

Please sign in to comment.