Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert variables to support defaults with override #267 #268

Merged
merged 6 commits into from
Oct 5, 2023
Merged
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
8 changes: 8 additions & 0 deletions .github/workflows/TestStatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ jobs:
- name: Run Static Tests
run: ddev task test:static

- name: Confirm custom directories are scanned
run: |
set -x
mkdir -p custom-yaml-directory
echo 'key: value' >> custom-yaml-directory/test.yml
ddev task test:static YAML_DIRS="custom-yaml-directory/*.yml" | tee static.log
[[ $(grep '\[OK] All 1 YAML files contain valid syntax.' static.log | wc -l) -eq 1 ]]

- name: Upload test artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
Expand Down
1 change: 0 additions & 1 deletion drainpipe-dev/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"ext-json": "*",
"composer-plugin-api": "^2.0",
"phpunit/phpunit": "^8|^9",
"j13k/yaml-lint": "^1.1",
"sserbin/twig-linter": "^3.0",
"mikey179/vfsstream": "^1.6",
"mockery/mockery": "^1.4",
Expand Down
10 changes: 4 additions & 6 deletions tasks/test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
version: '3'

# @todo allow these to be overridden or document them as required folder
# structures. See also config/phpstan.neon
vars:
YAML_DIRS: 'web/**/*.yml'
TWIG_DIRS: 'web/modules web/profiles web/themes'
YAML_DIRS: '{{ default "web/**/*.yml" .YAML_DIRS }}'
TWIG_DIRS: '{{ default "web/modules web/profiles web/themes" .TWIG_DIRS }}'
# These directories are configured in phpcs.xml. However, phpcs will fail if
# those directories do not exist, so we create them with the assumption that
# every Drupal site will eventually have these directories.
TEST_DIRS: 'web/modules/custom web/themes/custom web/sites'
NIGHTWATCH_TEST_DIRS: 'test'
TEST_DIRS: '{{ default "web/modules/custom web/themes/custom web/sites" .TEST_DIRS }}'
NIGHTWATCH_TEST_DIRS: '{{ default "test" .NIGHTWATCH_TEST_DIRS }}'
FUNC_ENSURE_DIRS: |
DIRS_ARR=({{.TEST_DIRS}})
for DIR in "${DIRS_ARR[@]}"; do
Expand Down