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

UHF-X Linters for subtheme WiP #82

Draft
wants to merge 8 commits into
base: dev
Choose a base branch
from
Draft
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
55 changes: 34 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,39 @@ jobs:
vendor/bin/phpcs public/modules/custom/ --ignore="*.js,*.css" --standard=Drupal
vendor/bin/phpcs public/themes/custom/ --ignore="*.js,*.css" --standard=Drupal

- name: Download latest dump
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh run download -n latest.sql
- name: Use Node.js v.16
uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci --prefix public/themes/custom/hdbt_subtheme --engine-strict true
- run: npm exec stylelint --prefix public/themes/custom/hdbt_subtheme "**/*.scss"

- name: Install Drupal
run: mysql --user=drupal --password=drupal --database=drupal --host=db --port=3306 -A < latest.sql

- name: Start services
run: |
drush runserver $SIMPLETEST_BASE_URL > /dev/null 2>&1 &
chromedriver --port=4444 > /dev/null 2>&1 &
# Uncomment the line below to run 'existing-site-javascript' tests.
# chromium-browser --headless --disable-gpu --remote-debugging-port=9222 &
# Wait for drush server to start.
for i in {1..5}; do RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$SIMPLETEST_BASE_URL" || true); if [ "$RESPONSE_CODE" -gt "301" ] || [ "$RESPONSE_CODE" -lt "200" ]; then sleep 2; fi; done

- name: Run PHPUnit tests
run: |
composer test-php public/modules/custom
# Uncomment the line below to run drupal-test-trait tests under tests/src/* folder.
# composer test-php tests/
# - name: Build and test
# run: |
# npm ci --prefix public/themes/custom/hdbt_subtheme --engine-strict true
# npm exec stylelint --prefix public/themes/custom/hdbt_subtheme "**/*.scss"

# - name: Download latest dump
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# gh run download -n latest.sql
#
# - name: Install Drupal
# run: mysql --user=drupal --password=drupal --database=drupal --host=db --port=3306 -A < latest.sql
#
# - name: Start services
# run: |
# drush runserver $SIMPLETEST_BASE_URL > /dev/null 2>&1 &
# chromedriver --port=4444 > /dev/null 2>&1 &
# # Uncomment the line below to run 'existing-site-javascript' tests.
# # chromium-browser --headless --disable-gpu --remote-debugging-port=9222 &
# # Wait for drush server to start.
# for i in {1..5}; do RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$SIMPLETEST_BASE_URL" || true); if [ "$RESPONSE_CODE" -gt "301" ] || [ "$RESPONSE_CODE" -lt "200" ]; then sleep 2; fi; done
#
# - name: Run PHPUnit tests
# run: |
# composer test-php public/modules/custom
# # Uncomment the line below to run drupal-test-trait tests under tests/src/* folder.
# # composer test-php tests/