@@ -71,11 +71,11 @@ jobs:
71
71
echo "Changed JS file count: $JS_FILE_COUNT"
72
72
echo "Changed GHA workflow file count: $GHA_WORKFLOW_COUNT"
73
73
74
- echo "::set-output name= count:: $FILE_COUNT"
75
- echo "::set-output name= php-count:: $PHP_FILE_COUNT"
76
- echo "::set-output name= css-count:: $CSS_FILE_COUNT"
77
- echo "::set-output name= js-count:: $JS_FILE_COUNT"
78
- echo "::set-output name= gha-workflow-count:: $GHA_WORKFLOW_COUNT"
74
+ echo "count= $FILE_COUNT" >> $GITHUB_OUTPUT
75
+ echo "php-count= $PHP_FILE_COUNT" >> $GITHUB_OUTPUT
76
+ echo "css-count= $CSS_FILE_COUNT" >> $GITHUB_OUTPUT
77
+ echo "js-count= $JS_FILE_COUNT" >> $GITHUB_OUTPUT
78
+ echo "gha-workflow-count= $GHA_WORKFLOW_COUNT" >> $GITHUB_OUTPUT
79
79
env :
80
80
# Ignore Paths:
81
81
# - .github/
@@ -176,7 +176,7 @@ jobs:
176
176
177
177
- name : Get Composer Cache Directory
178
178
id : composer-cache
179
- run : echo "::set-output name= dir:: $(composer config cache-files-dir)"
179
+ run : echo "dir= $(composer config cache-files-dir)" >> $GITHUB_OUTPUT
180
180
181
181
- name : Configure Composer cache
182
182
@@ -222,7 +222,7 @@ jobs:
222
222
223
223
- name : Get Composer Cache Directory
224
224
id : composer-cache
225
- run : echo "::set-output name= dir:: $(composer config cache-files-dir)"
225
+ run : echo "dir= $(composer config cache-files-dir)" >> $GITHUB_OUTPUT
226
226
227
227
- name : Configure Composer cache
228
228
@@ -304,7 +304,7 @@ jobs:
304
304
305
305
- name : Get Composer Cache Directory
306
306
id : composer-cache
307
- run : echo "::set-output name= dir:: $(composer config cache-files-dir)"
307
+ run : echo "dir= $(composer config cache-files-dir)" >> $GITHUB_OUTPUT
308
308
309
309
- name : Configure Composer cache
310
310
@@ -457,7 +457,7 @@ jobs:
457
457
- name : Get Composer Cache Directory
458
458
if : needs.pre-run.outputs.changed-php-count > 0
459
459
id : composer-cache
460
- run : echo "::set-output name= dir:: $(composer config cache-files-dir)"
460
+ run : echo "dir= $(composer config cache-files-dir)" >> $GITHUB_OUTPUT
461
461
462
462
- name : Configure Composer cache
463
463
if : needs.pre-run.outputs.changed-php-count > 0
@@ -475,7 +475,7 @@ jobs:
475
475
composer remove --dev phpdocumentor/reflection
476
476
composer install --prefer-dist --ignore-platform-reqs --no-progress --no-interaction
477
477
478
- # See https://github.com/wp-cli/wp-cli/issues/5484
478
+ # See https://github.com/wp-cli/wp-cli/issues/5484
479
479
- name : Remove conflicting Requests library
480
480
if : needs.pre-run.outputs.changed-php-count > 0
481
481
run : composer remove --dev --ignore-platform-reqs --no-interaction --no-scripts roave/security-advisories wp-cli/export-command wp-cli/extension-command wp-cli/wp-cli wp-cli/wp-cli-tests
@@ -567,7 +567,76 @@ jobs:
567
567
flags : php,unit
568
568
fail_ci_if_error : true
569
569
570
- # -----------------------------------------------------------------------------------------------------------------------
570
+ # -----------------------------------------------------------------------------------------------------------------------
571
+
572
+ unit-test-multisite-php :
573
+ name : ' Unit Tests Multisite: PHP 7.4, WP Latest'
574
+ needs : pre-run
575
+ runs-on : ubuntu-latest
576
+ if : needs.pre-run.outputs.changed-php-count > 0
577
+ strategy :
578
+ matrix :
579
+ testsuite : ['default', 'external-http']
580
+
581
+ steps :
582
+ - name : Checkout
583
+ uses : actions/checkout@v3
584
+
585
+ - name : Setup Node
586
+
587
+ with :
588
+ node-version-file : ' .nvmrc'
589
+ cache : npm
590
+
591
+ - name : Get Composer Cache Directory
592
+ id : composer-cache
593
+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
594
+
595
+ - name : Configure Composer cache
596
+
597
+ with :
598
+ path : ${{ steps.composer-cache.outputs.dir }}
599
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
600
+ restore-keys : |
601
+ ${{ runner.os }}-composer-
602
+
603
+ - name : Install Node dependencies
604
+ run : npm ci
605
+ env :
606
+ CI : true
607
+
608
+ - name : Install Composer dependencies
609
+ run : |
610
+ # phpdocumentor/reflection has to be removed as it makes use of an outdated dependency.
611
+ composer remove --dev phpdocumentor/reflection
612
+ composer install --prefer-dist --ignore-platform-reqs --no-progress --no-interaction
613
+
614
+ # See https://github.com/wp-cli/wp-cli/issues/5484
615
+ - name : Remove conflicting Requests library
616
+ run : composer remove --dev --ignore-platform-reqs --no-interaction --no-scripts roave/security-advisories wp-cli/export-command wp-cli/extension-command wp-cli/wp-cli wp-cli/wp-cli-tests
617
+
618
+ - name : Update PHPUnit
619
+ if : needs.pre-run.outputs.changed-php-count > 0
620
+ run : |
621
+ # We are using PHP 7.4 and WP Latest.
622
+ echo "Installing latest version of PHPUnit"
623
+ composer update --ignore-platform-reqs --no-interaction --no-scripts yoast/phpunit-polyfills --with-dependencies
624
+
625
+ - name : Build plugin
626
+ run : npm run build:js
627
+
628
+ - name : Move amp-wp to amp
629
+ run : cp -r "$PWD" "/tmp/amp"
630
+
631
+ - name : Start wp-env
632
+ working-directory : /tmp/amp
633
+ run : npm run wp-env start
634
+
635
+ - name : Run multisite unit tests
636
+ working-directory : /tmp/amp
637
+ run : npm run test:php:multisite ${{ matrix.testsuite == 'external-http' && '-- --testsuite external-http' || '' }}
638
+
639
+ # -----------------------------------------------------------------------------------------------------------------------
571
640
572
641
feature-test-php :
573
642
name : " Feature test${{ matrix.coverage && ' (with coverage)' || '' }}: PHP ${{ matrix.php }}, WP ${{ matrix.wp }}"
@@ -641,7 +710,7 @@ jobs:
641
710
642
711
- name : Get Composer Cache Directory
643
712
id : composer-cache
644
- run : echo "::set-output name= dir:: $(composer config cache-files-dir)"
713
+ run : echo "dir= $(composer config cache-files-dir)" >> $GITHUB_OUTPUT
645
714
646
715
- name : Configure Composer cache
647
716
@@ -741,8 +810,7 @@ jobs:
741
810
742
811
- name : Get Composer Cache Directory
743
812
id : composer-cache
744
- run : |
745
- echo "::set-output name=dir::$(composer config cache-files-dir)"
813
+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
746
814
747
815
- name : Configure Composer cache
748
816
@@ -774,11 +842,11 @@ jobs:
774
842
775
843
- name : Retrieve branch name
776
844
id : retrieve-branch-name
777
- run : echo "::set-output name= branch_name:: $(REF=${GITHUB_HEAD_REF:-$GITHUB_REF} && echo ${REF#refs/heads/} | sed 's/\//-/g')"
845
+ run : echo "branch_name= $(REF=${GITHUB_HEAD_REF:-$GITHUB_REF} && echo ${REF#refs/heads/} | sed 's/\//-/g')" >> $GITHUB_OUTPUT
778
846
779
847
- name : Retrieve git SHA-8 string
780
848
id : retrieve-git-sha-8
781
- run : echo "::set-output name= sha8:: $(echo ${GITHUB_SHA} | cut -c1-8)"
849
+ run : echo "sha8= $(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
782
850
783
851
- name : Upload build as artifact
784
852
uses : actions/upload-artifact@v3
@@ -847,7 +915,7 @@ jobs:
847
915
- Download [development build](https://storage.googleapis.com/ampwp_github_artifacts/${{ github.ref }}/dev/amp.zip?${{ github.sha }})
848
916
- Download [production build](https://storage.googleapis.com/ampwp_github_artifacts/${{ github.ref }}/prod/amp.zip?${{ github.sha }})"
849
917
body="${body//$'\n'/'%0A'}"
850
- echo "::set-output name= body:: $body"
918
+ echo "body= $body" >> $GITHUB_OUTPUT
851
919
852
920
- name : Create comment on PR with links to plugin builds
853
921
if : ${{ steps.find-comment.outputs.comment-id == '' }}
0 commit comments