From 4434356d282e41e76f2fa596d0b3a09b1eb05020 Mon Sep 17 00:00:00 2001 From: Koen Eelen Date: Tue, 16 Jul 2024 13:54:12 +0200 Subject: [PATCH 1/6] change pipeline to PHP 7.4 and add tests to pipeline --- .github/workflows/ci.yml | 120 ++++++++++++++++++++++++++------------- 1 file changed, 79 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7c1527c..5c3fa6fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,44 +3,82 @@ name: CI on: push jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: ['7.1', '7.2', '7.3', '7.4'] - name: PHP ${{ matrix.php-versions }} - steps: - - uses: actions/checkout@v2 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: intl - tools: composer:v1 - - - name: Check PHP Version - run: php -v - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v2 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Install composer dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer install --no-progress --no-suggest - - - name: Install npm dependencies - run: npm install - - - name: Run Phing - run: composer run-script phing + tests: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ['7.1', '7.2', '7.3', '7.4'] + name: Unit tests ${{ matrix.php-versions }} + steps: + - name: 📤 Checkout project + uses: actions/checkout@v4 + + - name: 🐘 Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + ini-values: xdebug.mode=coverage + extensions: bcmath, tidy + tools: composer + + - name: ✌️ Check PHP Version + run: php -v + + - name: 🛂 Validate composer.json and composer.lock + run: composer validate + + - name: 📩 Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}-v1 + restore-keys: | + ${{ runner.os }}-php- + + - name: 📦 Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --no-progress --no-suggest + + - name: ✅ Run tests + run: composer test + + tests: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ['7.1', '7.2', '7.3', '7.4'] + name: Unit tests ${{ matrix.php-versions }} + steps: + - name: 📤 Checkout project + uses: actions/checkout@v4 + + - name: 🐘 Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + ini-values: xdebug.mode=coverage + extensions: bcmath, tidy + tools: composer + + - name: ✌️ Check PHP Version + run: php -v + + - name: 🛂 Validate composer.json and composer.lock + run: composer validate + + - name: 📩 Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}-v1 + restore-keys: | + ${{ runner.os }}-php- + + - name: 📦 Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --no-progress --no-suggest + + - name: ✅ Run Phing + run: composer run-script phing From 49946f33b77f92d6b269b1f064ea03772e7930a2 Mon Sep 17 00:00:00 2001 From: Koen Eelen Date: Tue, 16 Jul 2024 13:59:50 +0200 Subject: [PATCH 2/6] updated composer to have tests --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5e5ad253..0c2e27fe 100644 --- a/composer.json +++ b/composer.json @@ -50,6 +50,7 @@ "minimum-stability": "dev", "prefer-stable": true, "scripts": { - "phing": "./vendor/bin/phing test" + "phing": "./vendor/bin/phing test", + "test": "./vendor/bin/phpunit" } } From c28ebc78ef03b57d0b1684c174ee7eaa0df4b1d2 Mon Sep 17 00:00:00 2001 From: Koen Eelen Date: Tue, 16 Jul 2024 14:00:18 +0200 Subject: [PATCH 3/6] Fixed pipeline --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c3fa6fb..9c866aa2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: - name: ✅ Run tests run: composer test - tests: + phing: runs-on: ubuntu-latest strategy: matrix: From ecb3cee4aa838c8dcec4babf5b0fe8ce6b99b02b Mon Sep 17 00:00:00 2001 From: Koen Eelen Date: Tue, 16 Jul 2024 14:01:29 +0200 Subject: [PATCH 4/6] only test php 7.4 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c866aa2..beb53612 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['7.1', '7.2', '7.3', '7.4'] + php-versions: ['7.4'] name: Unit tests ${{ matrix.php-versions }} steps: - name: 📤 Checkout project @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['7.1', '7.2', '7.3', '7.4'] + php-versions: ['7.4'] name: Unit tests ${{ matrix.php-versions }} steps: - name: 📤 Checkout project From 136955306395b26cd8e2f99c038ed5ea985f975f Mon Sep 17 00:00:00 2001 From: Koen Eelen Date: Tue, 16 Jul 2024 14:02:33 +0200 Subject: [PATCH 5/6] make phing label more clear --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index beb53612..6771d17d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: strategy: matrix: php-versions: ['7.4'] - name: Unit tests ${{ matrix.php-versions }} + name: Phing ${{ matrix.php-versions }} steps: - name: 📤 Checkout project uses: actions/checkout@v4 From 794f2e2b85b1e216e65def3e605ee93252f5c765 Mon Sep 17 00:00:00 2001 From: Koen Eelen Date: Tue, 16 Jul 2024 15:00:50 +0200 Subject: [PATCH 6/6] remove tests, phing already does this --- .github/workflows/ci.yml | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6771d17d..48ee9d27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,46 +3,6 @@ name: CI on: push jobs: - tests: - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: ['7.4'] - name: Unit tests ${{ matrix.php-versions }} - steps: - - name: 📤 Checkout project - uses: actions/checkout@v4 - - - name: 🐘 Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - ini-values: xdebug.mode=coverage - extensions: bcmath, tidy - tools: composer - - - name: ✌️ Check PHP Version - run: php -v - - - name: 🛂 Validate composer.json and composer.lock - run: composer validate - - - name: 📩 Cache Composer packages - id: composer-cache - uses: actions/cache@v3 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}-v1 - restore-keys: | - ${{ runner.os }}-php- - - - name: 📦 Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer install --no-progress --no-suggest - - - name: ✅ Run tests - run: composer test - phing: runs-on: ubuntu-latest strategy: