Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 45 additions & 11 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@ jobs:
COMPOSE_DOMAIN: test.local.example.org
COMPOSE_PROJECT_NAME: test_project
COMPOSE_SERVER_DOMAIN: test.example.org

TERM: xterm-256color

strategy:
fail-fast: false
matrix:
version: &template_version
- drupal-7
- drupal
- drupal-8
- drupal-9
- drupal-10
- drupal-11
- symfony-3
- symfony-4
- symfony
- symfony-6
- symfony-7
- symfony-8
name: Validate compose (${{ matrix.version }})
steps:
- uses: actions/checkout@v5

- name: Validate local docker compose files
run: |
DC=$(docker compose --file templates/${{ matrix.version }}/docker-compose.yml config --quiet 2>&1)
[ -z "$DC" ] || { echo $DC; exit 1; }
docker compose --file templates/${{ matrix.version }}/docker-compose.yml config

- name: Validate server docker compose files
run: |
DC=$(docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml config --quiet 2>&1)
[ -z "$DC" ] || { echo $DC; exit 1; }
DC=$(docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml --file templates/${{ matrix.version }}/docker-compose.dev.yml config --quiet 2>&1)
[ -z "$DC" ] || { echo $DC; exit 1; }
DC=$(docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml --file templates/${{ matrix.version }}/docker-compose.redirect.yml config --quiet 2>&1)
[ -z "$DC" ] || { echo $DC; exit 1; }
docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml config
docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml --file templates/${{ matrix.version }}/docker-compose.dev.yml config
docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml --file templates/${{ matrix.version }}/docker-compose.redirect.yml config

validate-nginx-conf:
runs-on: ubuntu-latest
Expand All @@ -62,3 +62,37 @@ jobs:
- name: Validate nginx conf
run: |
docker compose --file templates/${{ matrix.version }}/${{ matrix.compose_file}} run --rm nginx nginx -t

test-template-install:
runs-on: ubuntu-latest
env: *env

strategy:
fail-fast: false
matrix:
version: *template_version

name: Test template install (${{ matrix.version }})
steps:
- uses: actions/checkout@v5

- name: Install and check template
run: |
script_dir="$PWD/scripts"
test_dir="tmp/${{ matrix.version }}"

mkdir -p "$test_dir"
cd "$test_dir"
yes | "$script_dir/itkdev-docker-compose" template:install "${{ matrix.version }}" || true
# Remove .env file generated during template install
rm .env
cd -
pwd

# Check that we have no symlinks in the project.
find "$test_dir" -type l | grep . && exit 1

# Check that project files are exact copies of the template files.
diff -qr templates/"${{ matrix.version }}" "$test_dir"

rm -fr "$(dirname "$test_dir")"
8 changes: 3 additions & 5 deletions task/scripts/github-actions-link
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@ function strip-project-type() {
echo "$name"
}

find templates -type l -delete

for template_dir in templates/*; do
template_name=$(basename "$template_dir")

echo "$template_name"
echo

project_type=""
if [[ "$template_name" =~ ^drupal-module ]]; then
if [[ "$template_name" =~ ^drupal-module$ ]]; then
project_type="drupal-module"
elif [[ "$template_name" =~ ^drupal- ]]; then
elif [[ "$template_name" =~ ^drupal(-|$) ]]; then
project_type="drupal"
elif [[ "$template_name" =~ ^symfony- ]]; then
elif [[ "$template_name" =~ ^symfony(-|$) ]]; then
project_type="symfony"
else
(>&2 echo "Unknown template type: $template_name")
Expand Down
1 change: 1 addition & 0 deletions templates/drupal-10/.docker
27 changes: 0 additions & 27 deletions templates/drupal-10/docker-compose.dev.yml

This file was deleted.

1 change: 1 addition & 0 deletions templates/drupal-10/docker-compose.dev.yml
15 changes: 0 additions & 15 deletions templates/drupal-10/docker-compose.redirect.yml

This file was deleted.

1 change: 1 addition & 0 deletions templates/drupal-10/docker-compose.redirect.yml
64 changes: 0 additions & 64 deletions templates/drupal-10/docker-compose.server.yml

This file was deleted.

1 change: 1 addition & 0 deletions templates/drupal-10/docker-compose.server.yml
130 changes: 0 additions & 130 deletions templates/drupal-10/docker-compose.yml

This file was deleted.

1 change: 1 addition & 0 deletions templates/drupal-10/docker-compose.yml
1 change: 1 addition & 0 deletions templates/drupal-11/.docker
Loading