diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 6bcf3fc91..25b5cb76c 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -215,6 +215,59 @@ jobs: name: test_result path: test_result + Test-Yarn-4-Node-Linker: + runs-on: ubuntu-22.04 + needs: Build + steps: + - uses: actions/download-artifact@v3 + with: + name: test-functional-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - 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: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Nightwatch + run: | + ddev config --nodejs-version=21 + ddev restart + ddev yarn set version berry + ddev yarn set version 4 + ddev yarn init -y + yarn config set nodeLinker node-modules + ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands lodash --dev + + - name: Install Drupal + run: | + ddev drush --yes site:install + ddev drush --uri=https://drupal_firefox --yes site:install + ddev drush --uri=https://drupal_chrome --yes site:install + ddev drush config:export --yes + + - name: Run Functional Tests + run: ddev task test:functional + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: test_result + path: test_result + Test-Yarn-3: runs-on: ubuntu-22.04 needs: Build @@ -250,10 +303,63 @@ jobs: echo ' "nightwatch@*":' >> .yarnrc.yml echo ' dependencies:' >> .yarnrc.yml echo ' ws: "*"' >> .yarnrc.yml - echo ' lodash: "*"' >> .yarnrc.yml - echo ' rimraf: "*"' >> .yarnrc.yml ddev yarn add nightwatch nightwatch-axe-verbose @lullabot/nightwatch-drupal-commands --dev - yarn + + - name: Install Drupal + run: | + ddev drush --yes site:install + ddev drush --uri=https://drupal_firefox --yes site:install + ddev drush --uri=https://drupal_chrome --yes site:install + ddev drush config:export --yes + + - name: Run Functional Tests + run: ddev task test:functional + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: test_result + path: test_result + + Test-Yarn-4: + runs-on: ubuntu-22.04 + needs: Build + steps: + - uses: actions/download-artifact@v3 + with: + name: test-functional-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - 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: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Nightwatch + run: | + ddev config --nodejs-version=21 + ddev restart + ddev yarn set version berry + ddev yarn init -y + echo "packageExtensions:" >> .yarnrc.yml + echo ' "nightwatch@*":' >> .yarnrc.yml + echo ' dependencies:' >> .yarnrc.yml + echo ' ws: "*"' >> .yarnrc.yml + ddev yarn cache clear + ddev yarn add nightwatch nightwatch-axe-verbose @lullabot/nightwatch-drupal-commands --dev - name: Install Drupal run: | diff --git a/.github/workflows/TestMetapackages.yml b/.github/workflows/TestMetapackages.yml index 7ddd48f32..78cfe55a5 100644 --- a/.github/workflows/TestMetapackages.yml +++ b/.github/workflows/TestMetapackages.yml @@ -133,7 +133,7 @@ jobs: - name: Compile Sass run: ddev task sass - Test-Sass-Yarn-Berry: + Test-Sass-Yarn-3: runs-on: ubuntu-22.04 needs: Build steps: @@ -169,6 +169,45 @@ jobs: - name: Compile Sass run: ddev task sass + Test-Sass-Yarn-4: + runs-on: ubuntu-22.04 + needs: Build + steps: + - uses: actions/download-artifact@v3 + with: + name: test-metapackage-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - 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: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Sass + run: | + ddev config --nodejs-version=21 + ddev restart + ddev yarn set version berry + ddev yarn set version 4 + ddev yarn init -y + ddev yarn cache clear + ddev yarn add ./drainpipe/metapackages/sass --dev + + - name: Compile Sass + run: ddev task sass + Test-JavaScript-NPM: runs-on: ubuntu-22.04 needs: Build @@ -240,7 +279,7 @@ jobs: - name: Compile JavaScript run: ddev task javascript - Test-JavaScript-Yarn-Berry: + Test-JavaScript-Yarn-3: runs-on: ubuntu-22.04 needs: Build steps: @@ -276,3 +315,43 @@ jobs: - name: Compile JavaScript run: ddev task javascript + + Test-JavaScript-Yarn-4: + runs-on: ubuntu-22.04 + needs: Build + steps: + - uses: actions/download-artifact@v3 + with: + name: test-metapackage-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - 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: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Sass + run: | + ddev config --nodejs-version=21 + ddev restart + ddev yarn set version berry + ddev yarn set version 4 + ddev yarn init -y + ddev yarn cache clear + ddev yarn add focus-trap@^6.7.3 + ddev yarn add ./drainpipe/metapackages/javascript --dev + + - name: Compile JavaScript + run: ddev task javascript diff --git a/tasks/test.yml b/tasks/test.yml index 7f8ad89ca..5608db95a 100644 --- a/tasks/test.yml +++ b/tasks/test.yml @@ -205,9 +205,9 @@ tasks: interactive: true cmds: - | - PACKAGES="nightwatch nightwatch-axe-verbose @lullabot/nightwatch-drupal-commands" + PACKAGES="nightwatch @lullabot/nightwatch-drupal-commands" if [ ! -f "package.json" ]; then - echo -n "No package.json exists, would you like to use yarn1, npm, or yarn? " + echo -n "No package.json exists, would you like to use yarn1, npm, yarn3 (node <= 20), or yarn (node >= 21)? " read -r PACKAGE_MANAGER if [ "$PACKAGE_MANAGER" == "npm" ]; then if [ "$IS_DDEV_PROJECT" == "true" ]; then @@ -219,7 +219,7 @@ tasks: yarn set version classic yarn init -y yarn add $PACKAGES lodash --dev - elif [ "$PACKAGE_MANAGER" == "yarn" ]; then + elif [ "$PACKAGE_MANAGER" == "yarn3" ]; then yarn set version berry yarn set version 3 yarn init @@ -227,7 +227,15 @@ tasks: echo ' "nightwatch@*":' >> .yarnrc.yml echo ' dependencies:' >> .yarnrc.yml echo ' ws: "*"' >> .yarnrc.yml - echo ' lodash: "*"' >> .yarnrc.yml + yarn add $PACKAGES --dev + elif [ "$PACKAGE_MANAGER" == "yarn" ]; then + yarn set version berry + yarn init + echo "packageExtensions:" >> .yarnrc.yml + echo ' "nightwatch@*":' >> .yarnrc.yml + echo ' dependencies:' >> .yarnrc.yml + echo ' ws: "*"' >> .yarnrc.yml + yarn cache clear yarn add $PACKAGES --dev else echo "Sorry I'm not aware of that package manager. Please first init package.json with it yourself manually." diff --git a/tests/local-test.sh b/tests/local-test.sh index a232746c0..2be72c535 100755 --- a/tests/local-test.sh +++ b/tests/local-test.sh @@ -28,17 +28,16 @@ echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS fi echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS chrome; GRANT ALL ON chrome.* TO 'db'@'%';\"" >> .ddev/config.yaml ddev config --web-environment="NIGHTWATCH_DRUPAL_URL_FIREFOX=https://drupal_firefox,NIGHTWATCH_DRUPAL_URL_CHROME=https://drupal_chrome" ddev config --additional-hostnames="*.drainpipe" +ddev config --nodejs-version=21 ddev restart ddev yarn set version berry -ddev yarn set version 3 ddev yarn init -y +ddev yarn cache clear echo "packageExtensions:" >> .yarnrc.yml echo ' "nightwatch@*":' >> .yarnrc.yml echo ' dependencies:' >> .yarnrc.yml echo ' ws: "*"' >> .yarnrc.yml -echo ' lodash: "*"' >> .yarnrc.yml -echo ' rimraf: "*"' >> .yarnrc.yml ddev yarn add nightwatch nightwatch-axe-verbose @lullabot/nightwatch-drupal-commands --dev yarn