Skip to content

Commit

Permalink
Fix phpcs configuration (#217)
Browse files Browse the repository at this point in the history
Additionally add a test to check all static tests are run successfully
  • Loading branch information
justafish committed Jun 21, 2023
1 parent 1700d07 commit e1f9e87
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 2 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/TestStatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Test Static Tests
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
Test-Static:
runs-on: ubuntu-latest
steps:
- name: Create a Drupal project
run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd

- uses: actions/checkout@v3
with:
path: drainpipe

- name: Setup drainpipe-dev
run: mv drainpipe/drainpipe-dev .

- uses: ./drainpipe/scaffold/github/actions/common/set-env

- name: Install DDEV
uses: ./drainpipe/scaffold/github/actions/common/ddev
with:
git-name: Drainpipe Bot
git-email: [email protected]

- name: Setup Project
run: |
ddev config --auto
ddev start
ddev composer config extra.drupal-scaffold.gitignore true
ddev composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]'
ddev composer config --no-plugins allow-plugins.composer/installers true
ddev composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true
ddev composer config --no-plugins allow-plugins.lullabot/drainpipe true
ddev composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true
ddev composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}'
ddev composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}'
ddev composer config minimum-stability dev
ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies
ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies
# Restart is required to enable the provided Selenium containers
ddev restart
- name: Verify files were created
run: |
test -f phpcs.xml
- name: Fix settings.php
run: |
sed -i '/^.*container_yamls.*$/i /** @phpstan-ignore-next-line */' web/sites/default/settings.php
- name: Run Static Tests
run: ddev task test:static

- name: Upload test artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test_result
path: test_result
1 change: 0 additions & 1 deletion .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,3 @@ jobs:
command_line: xmllint --xpath 'string(//testsuites/testsuite/@tests)' test_result/phpunit.xml
contains: 12
expected_result: PASSED

3 changes: 2 additions & 1 deletion drainpipe-dev/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"[web-root]/sites/firefox/settings.php": "scaffold/nightwatch/firefox.settings.php",
"[web-root]/sites/sites.php": "scaffold/nightwatch/sites.php",
"[project-root]/.ddev/docker-compose.selenium.yaml": "scaffold/nightwatch/docker-compose.selenium.yaml",
"[project-root]/test/nightwatch/example.nightwatch.js": "scaffold/nightwatch/example.nightwatch.js"
"[project-root]/test/nightwatch/example.nightwatch.js": "scaffold/nightwatch/example.nightwatch.js",
"[project-root]/phpcs.xml": "scaffold/phpcs.xml"
}
}
},
Expand Down
File renamed without changes.

0 comments on commit e1f9e87

Please sign in to comment.