From ce177daf0beaf9d04d19c3a28ce9c6472f052c49 Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Wed, 11 Oct 2023 01:07:35 +0800 Subject: [PATCH 1/6] ci(next): fix Drupal version constraints in Composer commands Fixes #545 --- .github/workflows/next.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/next.yml b/.github/workflows/next.yml index 2b8b840a..c495c7ab 100644 --- a/.github/workflows/next.yml +++ b/.github/workflows/next.yml @@ -47,7 +47,7 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Setup Drupal run: | - COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal/recommended-project:${{ matrix.drupal }} ~/drupal --no-interaction --no-install + COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal/recommended-project:${{ matrix.drupal }}.x ~/drupal --no-interaction --no-install cd ~/drupal composer config extra.enable-patching true composer config extra.compile-mode all @@ -57,7 +57,7 @@ jobs: composer config repositories.0 path $GITHUB_WORKSPACE composer config repositories.1 composer https://packages.drupal.org/8 composer config allow-plugins true -n - COMPOSER_MEMORY_LIMIT=-1 composer require drupal/core-dev:${{ matrix.drupal }} --no-suggest --no-install + COMPOSER_MEMORY_LIMIT=-1 composer require drupal/core-dev --no-install composer install - name: Add phpspec/prophecy-phpunit run: | From 39ea830c86f93e6c1cb640f6f8133c4f9975565d Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Wed, 11 Oct 2023 01:22:00 +0800 Subject: [PATCH 2/6] ci(next): remove Drupal 9.4 from CI test matrix --- .github/workflows/next.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/next.yml b/.github/workflows/next.yml index c495c7ab..1bd060f3 100644 --- a/.github/workflows/next.yml +++ b/.github/workflows/next.yml @@ -10,11 +10,13 @@ jobs: runs-on: ubuntu-latest strategy: matrix: + # Supported PHP versions: https://www.drupal.org/docs/getting-started/system-requirements/php-requirements php: ["8.0", "8.1"] - drupal: ["9.4", "9.5", "10.0"] + # Supported Drupal versions: https://www.drupal.org/project/drupal + drupal: ["9.5", "10.0"] exclude: - - php: "8.0" - drupal: "10.0" + - drupal: "10.0" + php: "8.0" name: Drupal ${{ matrix.drupal }} - PHP ${{ matrix.php }} services: mysql: From 607361f79a645eed49e7f6fbc3203180cc7c35db Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Wed, 11 Oct 2023 01:23:29 +0800 Subject: [PATCH 3/6] ci(next): add PHP 8.2 to CI test matrix --- .github/workflows/next.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/next.yml b/.github/workflows/next.yml index 1bd060f3..28c34eda 100644 --- a/.github/workflows/next.yml +++ b/.github/workflows/next.yml @@ -11,10 +11,12 @@ jobs: strategy: matrix: # Supported PHP versions: https://www.drupal.org/docs/getting-started/system-requirements/php-requirements - php: ["8.0", "8.1"] + php: ["8.0", "8.1", "8.2"] # Supported Drupal versions: https://www.drupal.org/project/drupal drupal: ["9.5", "10.0"] exclude: + - drupal: "9.5" + php: "8.2" - drupal: "10.0" php: "8.0" name: Drupal ${{ matrix.drupal }} - PHP ${{ matrix.php }} From ac272127cd7c93f9fb2d278cbb39a6f77b360964 Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Wed, 11 Oct 2023 01:41:17 +0800 Subject: [PATCH 4/6] ci(next): replace set-output with output parameter GitHub Actions' "set-output" is deprecated. See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ --- .github/workflows/next.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/next.yml b/.github/workflows/next.yml index 28c34eda..4cac19c4 100644 --- a/.github/workflows/next.yml +++ b/.github/workflows/next.yml @@ -41,7 +41,7 @@ jobs: id: composercache run: | cd modules/next - echo "::set-output name=dir::$(composer config cache-files-dir)" + echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" - uses: actions/cache@v2 with: path: ${{ steps.composercache.outputs.dir }} From 1b3249145055d56ba5332a934e255f0ded39a025 Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Wed, 11 Oct 2023 02:19:25 +0800 Subject: [PATCH 5/6] ci(next): remove deprecated GH workflow --- modules/next/.github/workflows/main.yml | 66 ------------------------- 1 file changed, 66 deletions(-) delete mode 100644 modules/next/.github/workflows/main.yml diff --git a/modules/next/.github/workflows/main.yml b/modules/next/.github/workflows/main.yml deleted file mode 100644 index eaa9f81f..00000000 --- a/modules/next/.github/workflows/main.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Tests -on: - push: - pull_request: - branches: - - 8.x-1.x - -jobs: - phpunit: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - drupal: "^8.9" - name: Drupal ${{ matrix.drupal }} - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: db - ports: - - 3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@v2 - with: - php-version: 7.1 - extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, soap, intl, gd, exif, iconv - coverage: none - tools: composer:v1 - - name: Get composer cache directory - id: composercache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - uses: actions/cache@v2 - with: - path: ${{ steps.composercache.outputs.dir }} - key: ${{ runner.os }}-${{ matrix.drupal }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - name: Setup problem matchers for PHPUnit - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Setup Drupal - run: | - COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal/recommended-project:${{ matrix.drupal }} ~/drupal --no-interaction - cd ~/drupal - composer config extra.enable-patching true - composer config extra.compile-mode all - composer config minimum-stability dev - composer config prefer-stable true - composer config preferred-install dist - composer config repositories.0 path $GITHUB_WORKSPACE - composer config repositories.1 composer https://packages.drupal.org/8 - COMPOSER_MEMORY_LIMIT=-1 composer require drupal/core-dev:${{ matrix.drupal }} --no-suggest - - name: Copy module - run: cp -R ../next-drupal-module ~/drupal/web/modules/next - - name: Run php built-in server - run: php -S 127.0.0.1:8080 -t ~/drupal/web & - - name: Run PHPUnit - run: | - cd ~/drupal/web - ../vendor/bin/phpunit -c core modules/next - env: - SYMFONY_DEPRECATIONS_HELPER: weak - SIMPLETEST_DB: mysql://root:@127.0.0.1:${{ job.services.mysql.ports[3306] }}/db - SIMPLETEST_BASE_URL: http://127.0.0.1:8080 From e859310a9d42f5580731629bdd22df055fea6923 Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Wed, 11 Oct 2023 02:35:16 +0800 Subject: [PATCH 6/6] ci: update GitHub actions versions --- .github/workflows/next-drupal-query.yml | 2 +- .github/workflows/next-drupal.yml | 2 +- .github/workflows/next.yml | 6 +++--- .github/workflows/release-pr.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/next-drupal-query.yml b/.github/workflows/next-drupal-query.yml index 5ebe1ccd..0e5515c5 100644 --- a/.github/workflows/next-drupal-query.yml +++ b/.github/workflows/next-drupal-query.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install modules run: yarn - name: Run tests diff --git a/.github/workflows/next-drupal.yml b/.github/workflows/next-drupal.yml index f34d98c0..477cd61e 100644 --- a/.github/workflows/next-drupal.yml +++ b/.github/workflows/next-drupal.yml @@ -7,7 +7,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{github.event.pull_request.head.ref}} repository: ${{github.event.pull_request.head.repo.full_name}} diff --git a/.github/workflows/next.yml b/.github/workflows/next.yml index 4cac19c4..fdfb3c8b 100644 --- a/.github/workflows/next.yml +++ b/.github/workflows/next.yml @@ -30,7 +30,7 @@ jobs: - 3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -42,11 +42,11 @@ jobs: run: | cd modules/next echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: ${{ steps.composercache.outputs.dir }} key: ${{ runner.os }}-${{ matrix.drupal }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- + restore-keys: ${{ runner.os }}-${{ matrix.drupal }}-composer- - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Setup Drupal diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 028ab194..bfbb213d 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -10,7 +10,7 @@ jobs: environment: Preview steps: - name: Init - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: Setup Node