Skip to content

Commit d82d161

Browse files
committed
DEBUG
1 parent f64c278 commit d82d161

4 files changed

Lines changed: 33 additions & 5 deletions

File tree

.github/workflows/project.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v5
1919

20+
# https://github.com/mxschmitt/action-tmate?tab=readme-ov-file#manually-triggered-debug
21+
# Enable tmate debugging if debug logging is enabled (cf.
22+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#runner-context)
23+
- name: Setup tmate session
24+
uses: mxschmitt/action-tmate@v3
25+
with:
26+
limit-access-to-actor: false
27+
if: 1 == runner.debug
28+
2029
- run: |
2130
./scripts/code-analysis
2231

Taskfile.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,24 @@ tasks:
132132
# Cf. .github/workflows/yaml.yaml
133133
- docker compose run --rm prettier '**/*.{yml,yaml}' --check
134134

135+
code-analysis:phpstan:
136+
desc: Run static code analysis
137+
cmds:
138+
- ./scripts/code-analysis
139+
140+
code-analysis:rector:
141+
desc: Run static code analysis
142+
cmds:
143+
- ./scripts/rector
144+
145+
code-analysis:build-image:
146+
desc: Build Drupal image used for static code analysis
147+
prompt: Really?
148+
cmds:
149+
- docker image rm drupal-module-drupal --force
150+
- docker builder prune --force
151+
- BUILDKIT_PROGRESS=plain docker compose --project-directory scripts build
152+
135153
test:
136154
cmds:
137155
- docker compose run --env PHP_XDEBUG_MODE --env PHP_XDEBUG_WITH_REQUEST --env PHP_IDE_CONFIG --rm phpfpm vendor/bin/phpunit {{.CLI_ARGS}}

scripts/base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ trap teardown EXIT
7676
setup() {
7777
# compose down --remove-orphans
7878
compose pull --ignore-buildable
79-
compose up --detach --remove-orphans --wait # --build
79+
compose up --detach --remove-orphans --wait
8080

8181
# Finally, install our module.
8282
drush --yes pm:install "$module_name"

scripts/compose.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ services:
66
build:
77
context: ../
88
dockerfile_inline: |
9-
FROM drupal:${DRUPAL_VERSION:-10}-apache
9+
FROM drupal:${DRUPAL_VERSION:-10}-php${PHP_VERSION:-8.3}-apache
1010
1111
COPY ./composer.json web/modules/${MODULE_NAME?}/
1212
1313
# https://github.com/docker-library/docs/blob/master/php/README.md#how-to-install-more-php-extensions
14-
RUN apt update && apt --yes install git libxml2-dev libxslt1-dev \
14+
RUN apt-get update && apt-get --yes install git libxml2-dev libxslt1-dev \
1515
&& docker-php-ext-configure soap \
1616
&& docker-php-ext-install soap \
1717
&& docker-php-ext-configure xsl \
@@ -34,7 +34,8 @@ services:
3434
&& composer --no-plugins config extra.merge-plugin.merge-extra --json true \
3535
&& composer --no-plugins config extra.merge-plugin.merge-extra-deep --json true \
3636
&& composer --no-plugins config extra.merge-plugin.include "web/modules/${MODULE_NAME?}/composer.json" \
37-
&& composer require mglaman/composer-drupal-lenient wikimedia/composer-merge-plugin --with-all-dependencies
37+
&& composer require mglaman/composer-drupal-lenient wikimedia/composer-merge-plugin --with-all-dependencies \
38+
&& composer update --with-all-dependencies
3839
3940
# Patch to make COMPOSER_IGNORE_PLATFORM_REQS=1 have effect
4041
# https://github.com/wikimedia/composer-merge-plugin/pull/253
@@ -46,7 +47,7 @@ services:
4647
4748
# Install a minimal Drupal site.
4849
# https://www.drush.org/13.x/commands/site_install/
49-
RUN drush --yes site:install --db-url=sqlite://sites/default/files/.ht.sqlite?module=sqlite minimal -vvv
50+
RUN vendor/bin/drush --yes site:install --db-url=sqlite://sites/default/files/.ht.sqlite?module=sqlite minimal -vvv
5051
5152
ports:
5253
- 80

0 commit comments

Comments
 (0)