Skip to content

Commit

Permalink
Convert variables to support defaults with override #267 (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
deviantintegral authored Oct 5, 2023
1 parent b828d09 commit 91b8a23
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
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

0 comments on commit 91b8a23

Please sign in to comment.