From cef732f3a0cc612347d0310dd7f42b606f6e6518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 1 Jul 2022 11:34:45 +0300 Subject: [PATCH 1/8] Testing stylelinter. --- .github/workflows/test.yml | 50 ++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e5302115..f3aa9e78f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,8 @@ env: SIMPLETEST_BASE_URL: "http://127.0.0.1:8080" SYMFONY_DEPRECATIONS_HELPER: disabled XDEBUG_MODE: off + NODE_VERSION: 16 + DRUPAL_THEME_NAME: "hdbt_subtheme" jobs: tests: runs-on: ubuntu-latest @@ -35,26 +37,32 @@ 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 + - name: Run SCSS linters + uses: actions-hub/stylelint@master 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 + PATTERN: "*.scss" + CONFIG_PATH: ./public/themes/custom/${DRUPAL_THEME_NAME} - - 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: 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/ From 1a03f4ae72863abd1194ff363ab09a500e176fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 1 Jul 2022 11:54:34 +0300 Subject: [PATCH 2/8] Testing another way to lint styles. --- .github/workflows/test.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3aa9e78f..07e285f2e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,11 +37,15 @@ jobs: vendor/bin/phpcs public/modules/custom/ --ignore="*.js,*.css" --standard=Drupal vendor/bin/phpcs public/themes/custom/ --ignore="*.js,*.css" --standard=Drupal - - name: Run SCSS linters - uses: actions-hub/stylelint@master - env: - PATTERN: "*.scss" - CONFIG_PATH: ./public/themes/custom/${DRUPAL_THEME_NAME} + - name: Use Node.js $NODE_VERSION + uses: actions/setup-node@v3 + with: + node-version: $NODE_VERSION + + - name: Build and test + run: | + npm ci --prefix ./public/themes/custom/${DRUPAL_THEME_NAME} --engine-strict true + npm exec stylelint --prefix ./public/themes/custom/${DRUPAL_THEME_NAME} "**/*.scss" # - name: Download latest dump # env: From e7ee7a288cf6ec4cf91f1823ad260643669d2d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 1 Jul 2022 11:58:55 +0300 Subject: [PATCH 3/8] Fixed typo. --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 07e285f2e..39f31ecf3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,10 +37,10 @@ jobs: vendor/bin/phpcs public/modules/custom/ --ignore="*.js,*.css" --standard=Drupal vendor/bin/phpcs public/themes/custom/ --ignore="*.js,*.css" --standard=Drupal - - name: Use Node.js $NODE_VERSION + - name: Use Node.js ${NODE_VERSION} uses: actions/setup-node@v3 with: - node-version: $NODE_VERSION + node-version: ${NODE_VERSION} - name: Build and test run: | From d8091cf070b4e30331a9cb33b3fd2b798ace2334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 1 Jul 2022 12:03:42 +0300 Subject: [PATCH 4/8] Fixed typo. --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 39f31ecf3..30da8b99a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,6 @@ env: SIMPLETEST_BASE_URL: "http://127.0.0.1:8080" SYMFONY_DEPRECATIONS_HELPER: disabled XDEBUG_MODE: off - NODE_VERSION: 16 DRUPAL_THEME_NAME: "hdbt_subtheme" jobs: tests: @@ -37,10 +36,10 @@ jobs: vendor/bin/phpcs public/modules/custom/ --ignore="*.js,*.css" --standard=Drupal vendor/bin/phpcs public/themes/custom/ --ignore="*.js,*.css" --standard=Drupal - - name: Use Node.js ${NODE_VERSION} + - name: Use Node.js v.16 uses: actions/setup-node@v3 with: - node-version: ${NODE_VERSION} + node-version: 16 - name: Build and test run: | From dcbb800b28fc60f7c6351bcbc0717084e01a4338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 1 Jul 2022 12:12:17 +0300 Subject: [PATCH 5/8] More testing... --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 30da8b99a..2a505cbe7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,8 +43,8 @@ jobs: - name: Build and test run: | - npm ci --prefix ./public/themes/custom/${DRUPAL_THEME_NAME} --engine-strict true - npm exec stylelint --prefix ./public/themes/custom/${DRUPAL_THEME_NAME} "**/*.scss" + npm ci --prefix public/themes/custom/$DRUPAL_THEME_NAME --engine-strict true + npm exec stylelint --prefix public/themes/custom/$DRUPAL_THEME_NAME "**/*.scss" # - name: Download latest dump # env: From 822285f52278cf1ed8c3e973760abb398166de9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Fri, 1 Jul 2022 12:19:46 +0300 Subject: [PATCH 6/8] More testing... --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a505cbe7..e0d384615 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,6 @@ env: SIMPLETEST_BASE_URL: "http://127.0.0.1:8080" SYMFONY_DEPRECATIONS_HELPER: disabled XDEBUG_MODE: off - DRUPAL_THEME_NAME: "hdbt_subtheme" jobs: tests: runs-on: ubuntu-latest @@ -43,8 +42,8 @@ jobs: - name: Build and test run: | - npm ci --prefix public/themes/custom/$DRUPAL_THEME_NAME --engine-strict true - npm exec stylelint --prefix public/themes/custom/$DRUPAL_THEME_NAME "**/*.scss" + 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: From 5b865fa1540b1b1828c64c475e26201961988d4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Mon, 4 Jul 2022 08:44:00 +0300 Subject: [PATCH 7/8] More testing... --- .github/workflows/test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0d384615..cc3fe7cba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,12 +35,10 @@ jobs: vendor/bin/phpcs public/modules/custom/ --ignore="*.js,*.css" --standard=Drupal vendor/bin/phpcs public/themes/custom/ --ignore="*.js,*.css" --standard=Drupal - - name: Use Node.js v.16 + - name: Build and test styles uses: actions/setup-node@v3 with: node-version: 16 - - - 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" From 4ec39edc19e721ceec1126331c3236f85d5c2f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Kalij=C3=A4rvi?= Date: Mon, 4 Jul 2022 08:55:01 +0300 Subject: [PATCH 8/8] More testing... --- .github/workflows/test.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cc3fe7cba..7c0596a3f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,13 +35,18 @@ jobs: vendor/bin/phpcs public/modules/custom/ --ignore="*.js,*.css" --standard=Drupal vendor/bin/phpcs public/themes/custom/ --ignore="*.js,*.css" --standard=Drupal - - name: Build and test styles + - 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 - npm exec stylelint --prefix public/themes/custom/hdbt_subtheme "**/*.scss" + - run: npm ci --prefix public/themes/custom/hdbt_subtheme --engine-strict true + - run: npm exec stylelint --prefix public/themes/custom/hdbt_subtheme "**/*.scss" + + +# - 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: