Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybellwood committed Sep 11, 2024
1 parent 486e314 commit 5d3e627
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/drupal-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Drupal test routine

on:
push:
branches:
- 'main'
- 'dev'
pull_request:
branches:
- 'main'

jobs:
test-suite:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push local
uses: docker/bake-action@v5
with:
load: true
set: |
*.platform=linux/amd64
cli.tags=drupal-base-cli:latest
nginx.tags=drupal-base-nginx:latest
php.tags=drupal-base-php:latest
- name: replace docker-compose.yml
run: |
mv docker-compose.images.yml docker-compose.yml
- name: Install test harness
run: |
yarn add leia-parser mocha chai@4 command-line-test
- name: Generate test files
run: |
yarn leia "TESTING*.md" test -r 2 -s 'Start up tests' -t 'Verification commands' -c 'Destroy tests' --split-file
- name: Run docker compose tests
run: |
yarn mocha --timeout 900000 test/*compose*.func.js
55 changes: 55 additions & 0 deletions docker-compose.images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
services:
cli: # cli container, will be used for executing composer and any local commands (drush, drupal, etc.)
hostname: cli
image: drupal-base-cli:latest
labels:
# Lagoon Labels
lagoon.type: cli-persistent
lagoon.persistent.name: nginx # mount the persistent storage of nginx into this container
lagoon.persistent: /app/web/sites/default/files/ # location where the persistent storage should be mounted
lando.type: php-cli-drupal
user: root

nginx:
hostname: nginx
image: drupal-base-nginx:latest
labels:
lagoon.type: nginx-php-persistent
lagoon.persistent: /app/web/sites/default/files/ # define where the persistent storage should be mounted too
lando.type: nginx-drupal
ports:
- "8080" # exposes the port 8080 with a random local port, find it with `docker-compose port nginx 8080`
user: "1000"
depends_on:
- cli # basically just tells docker-compose to build the cli first
environment:
LAGOON_LOCALDEV_URL: http://${COMPOSE_PROJECT_NAME:-drupal-base}.docker.amazee.io
networks:
- amazeeio-network
- default

php:
hostname: php
image: drupal-base-php:latest
labels:
lagoon.type: nginx-php-persistent
lagoon.name: nginx # we want this service be part of the nginx pod in Lagoon
lagoon.persistent: /app/web/sites/default/files/ # define where the persistent storage should be mounted too
lando.type: php-fpm
user: "1000"
depends_on:
- cli # basically just tells docker-compose to build the cli first

mariadb:
image: uselagoon/mariadb-10.11-drupal:latest
labels:
lagoon.type: mariadb
lando.type: mariadb-drupal
ports:
- "3306" # exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306`
user: "1000"

networks:
amazeeio-network:
external: true
default:

0 comments on commit 5d3e627

Please sign in to comment.