From 06167977a5d83a29add2163f717f12dd5f66daa4 Mon Sep 17 00:00:00 2001 From: kurozumi Date: Sun, 28 Feb 2021 18:40:10 +0900 Subject: [PATCH 01/10] =?UTF-8?q?PHPUnit=E7=94=A8=E3=81=AEGitHub=20Action?= =?UTF-8?q?=E3=81=AEWorkFlow=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/{composer-v1.yaml => test.yaml} | 41 ++++++++----------- 1 file changed, 16 insertions(+), 25 deletions(-) rename .github/workflows/{composer-v1.yaml => test.yaml} (78%) diff --git a/.github/workflows/composer-v1.yaml b/.github/workflows/test.yaml similarity index 78% rename from .github/workflows/composer-v1.yaml rename to .github/workflows/test.yaml index c6661d6..68b3b31 100644 --- a/.github/workflows/composer-v1.yaml +++ b/.github/workflows/test.yaml @@ -1,5 +1,5 @@ # @see https://github.com/kurozumi -name: CI/CD for EC-CUBE4 Plugin with Composer:v1 +name: CI/CD for EC-CUBE4 Plugin on: [workflow_dispatch, pull_request] env: PLUGIN_NAME: DataMigration4 @@ -44,8 +44,11 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - name: Checkout - uses: actions/checkout@master + - name: Checkout EC-CUBE + uses: actions/checkout@v2 + with: + repository: EC-CUBE/ec-cube + ref: ${{ matrix.eccube-versions }} - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@master #https://github.com/shivammathur/setup-php @@ -54,12 +57,6 @@ jobs: extensions: mbstring, xml, ctype, iconv, mysql, intl, zip, pgsql tools: composer:v1 - - name: Clone EC-CUBE - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - tar cvzf $HOME/${PLUGIN_NAME}.tar.gz ./* - git clone https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/EC-CUBE/ec-cube.git -b ${{ matrix.eccube-versions }} --depth=1 - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" @@ -75,25 +72,21 @@ jobs: - name: Install Composer dependencies run : | - cd ec-cube composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader composer require --dev kiy0taka/eccube4-test-fixer composer require pear/pear-core-minimal:^1.10.10 pear/archive_tar:^1.4.13 wapmorgan/unified-archive:^1.1.1 nobuhiko/bulk-insert-query - - name: Setup EC-CUBE - run: | - cd ec-cube - bin/console doctrine:schema:create - bin/console eccube:fixtures:load - env: - DATABASE_URL: ${{ matrix.database_url }} - DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }} - - name: Install Plugin + - name: Checkout + uses: actions/checkout@v2 + with: + path: app/Plugin/${PLUGIN_NAME} + + - name: Setup EC-CUBE and Plugin run: | - cd ec-cube - bin/console eccube:plugin:install --path=$HOME/${PLUGIN_NAME}.tar.gz + composer compile + bin/console eccube:plugin:install --code ${PLUGIN_NAME} bin/console cache:clear --no-warmup - bin/console eccube:plugin:enable --code=${PLUGIN_NAME} + bin/console eccube:plugin:enable --code ${PLUGIN_NAME} env: DATABASE_URL: ${{ matrix.database_url }} DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }} @@ -101,8 +94,7 @@ jobs: - name: Run Tests for EC-CUBE4.0 if: matrix.eccube-versions == '4.0' run: | - cd ec-cube - find app/Plugin/DataMigration4/Tests -name "*Test.php" | while read TESTCASE + find app/Plugin/${PLUGIN_NAME}/Tests -name "*Test.php" | while read TESTCASE do bin/phpunit --include-path vendor/kiy0taka/eccube4-test-fixer/src --loader 'Eccube\PHPUnit\Loader\Eccube4CompatTestSuiteLoader' ${TESTCASE} done @@ -113,7 +105,6 @@ jobs: - name: Run Tests if: matrix.eccube-versions != '4.0' run: | - cd ec-cube bin/phpunit app/Plugin/${PLUGIN_NAME}/Tests env: DATABASE_URL: ${{ matrix.database_url }} From 3dee01047c2cfa22c5adb822b80d640b663f906f Mon Sep 17 00:00:00 2001 From: kurozumi Date: Sun, 28 Feb 2021 19:07:39 +0900 Subject: [PATCH 02/10] update --- .github/workflows/test.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 68b3b31..971addb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -81,6 +81,11 @@ jobs: with: path: app/Plugin/${PLUGIN_NAME} + -name: check path + run: | + cd app/Pluguin + ls -la + - name: Setup EC-CUBE and Plugin run: | composer compile From 7f15e8028d384a4627e3ce59680fdadbe72cb718 Mon Sep 17 00:00:00 2001 From: kurozumi Date: Sun, 28 Feb 2021 19:08:56 +0900 Subject: [PATCH 03/10] update --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 971addb..2f7e859 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -83,7 +83,7 @@ jobs: -name: check path run: | - cd app/Pluguin + cd app/Plugin ls -la - name: Setup EC-CUBE and Plugin From d4bc301135c5163a9cebe62a7826f1ba39df136f Mon Sep 17 00:00:00 2001 From: kurozumi Date: Sun, 28 Feb 2021 19:23:37 +0900 Subject: [PATCH 04/10] update --- .github/workflows/test.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2f7e859..a2ac3e6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -82,9 +82,7 @@ jobs: path: app/Plugin/${PLUGIN_NAME} -name: check path - run: | - cd app/Plugin - ls -la + run: ls app/Plugin - name: Setup EC-CUBE and Plugin run: | From 4dbd5985c91b26adea9403f1b0a73418cb7e400b Mon Sep 17 00:00:00 2001 From: kurozumi Date: Sun, 28 Feb 2021 19:24:38 +0900 Subject: [PATCH 05/10] update --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a2ac3e6..b2f20ce 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -81,7 +81,7 @@ jobs: with: path: app/Plugin/${PLUGIN_NAME} - -name: check path + - name: check path run: ls app/Plugin - name: Setup EC-CUBE and Plugin From 04f25a81b2a0781b6a19a1f98be215958115ead1 Mon Sep 17 00:00:00 2001 From: kurozumi Date: Sun, 28 Feb 2021 19:32:13 +0900 Subject: [PATCH 06/10] update --- .github/workflows/test.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b2f20ce..2e73faa 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -79,17 +79,14 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - path: app/Plugin/${PLUGIN_NAME} - - - name: check path - run: ls app/Plugin + path: app/Plugin/${{ PLUGIN_NAME }} - name: Setup EC-CUBE and Plugin run: | composer compile - bin/console eccube:plugin:install --code ${PLUGIN_NAME} + bin/console eccube:plugin:install --code ${{ PLUGIN_NAME }} bin/console cache:clear --no-warmup - bin/console eccube:plugin:enable --code ${PLUGIN_NAME} + bin/console eccube:plugin:enable --code ${{ PLUGIN_NAME }} env: DATABASE_URL: ${{ matrix.database_url }} DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }} @@ -97,7 +94,7 @@ jobs: - name: Run Tests for EC-CUBE4.0 if: matrix.eccube-versions == '4.0' run: | - find app/Plugin/${PLUGIN_NAME}/Tests -name "*Test.php" | while read TESTCASE + find app/Plugin/${{ PLUGIN_NAME }}/Tests -name "*Test.php" | while read TESTCASE do bin/phpunit --include-path vendor/kiy0taka/eccube4-test-fixer/src --loader 'Eccube\PHPUnit\Loader\Eccube4CompatTestSuiteLoader' ${TESTCASE} done @@ -108,7 +105,7 @@ jobs: - name: Run Tests if: matrix.eccube-versions != '4.0' run: | - bin/phpunit app/Plugin/${PLUGIN_NAME}/Tests + bin/phpunit app/Plugin/${{ PLUGIN_NAME }}/Tests env: DATABASE_URL: ${{ matrix.database_url }} DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }} From b2ca260a1ce55b49baf46ea788ce5e8681dfa895 Mon Sep 17 00:00:00 2001 From: kurozumi Date: Sun, 28 Feb 2021 19:37:05 +0900 Subject: [PATCH 07/10] update --- .github/workflows/test.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2e73faa..716e929 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -79,14 +79,14 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - path: app/Plugin/${{ PLUGIN_NAME }} + path: app/Plugin/$PLUGIN_NAME - name: Setup EC-CUBE and Plugin run: | composer compile - bin/console eccube:plugin:install --code ${{ PLUGIN_NAME }} + bin/console eccube:plugin:install --code $PLUGIN_NAME bin/console cache:clear --no-warmup - bin/console eccube:plugin:enable --code ${{ PLUGIN_NAME }} + bin/console eccube:plugin:enable --code $PLUGIN_NAME env: DATABASE_URL: ${{ matrix.database_url }} DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }} @@ -94,7 +94,7 @@ jobs: - name: Run Tests for EC-CUBE4.0 if: matrix.eccube-versions == '4.0' run: | - find app/Plugin/${{ PLUGIN_NAME }}/Tests -name "*Test.php" | while read TESTCASE + find app/Plugin/$PLUGIN_NAME/Tests -name "*Test.php" | while read TESTCASE do bin/phpunit --include-path vendor/kiy0taka/eccube4-test-fixer/src --loader 'Eccube\PHPUnit\Loader\Eccube4CompatTestSuiteLoader' ${TESTCASE} done @@ -105,7 +105,7 @@ jobs: - name: Run Tests if: matrix.eccube-versions != '4.0' run: | - bin/phpunit app/Plugin/${{ PLUGIN_NAME }}/Tests + bin/phpunit app/Plugin/$PLUGIN_NAME/Tests env: DATABASE_URL: ${{ matrix.database_url }} DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }} From d09d2cb541e423764c56af2c52ef7f74b2e28d2d Mon Sep 17 00:00:00 2001 From: kurozumi Date: Sun, 28 Feb 2021 19:47:15 +0900 Subject: [PATCH 08/10] update --- .github/workflows/test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 716e929..28e202c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -81,6 +81,9 @@ jobs: with: path: app/Plugin/$PLUGIN_NAME + - name: show plugin path + run: ls app/Plugin + - name: Setup EC-CUBE and Plugin run: | composer compile From 2c400dd29d3677d82e2d46cdaa132d4c1db8b2ba Mon Sep 17 00:00:00 2001 From: kurozumi Date: Sun, 28 Feb 2021 19:51:06 +0900 Subject: [PATCH 09/10] update --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 28e202c..f71b936 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -79,7 +79,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - path: app/Plugin/$PLUGIN_NAME + path: app/Plugin/DataMigration4 - name: show plugin path run: ls app/Plugin From e6d637205ad8aa3503432ba3f924523584566bb3 Mon Sep 17 00:00:00 2001 From: kurozumi Date: Sun, 28 Feb 2021 19:55:06 +0900 Subject: [PATCH 10/10] update --- .github/workflows/test.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f71b936..90abb55 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -81,9 +81,6 @@ jobs: with: path: app/Plugin/DataMigration4 - - name: show plugin path - run: ls app/Plugin - - name: Setup EC-CUBE and Plugin run: | composer compile