From f2298aa83cc2052e2a453342bc37dbe0608befef Mon Sep 17 00:00:00 2001 From: Rougin Gutib Date: Thu, 16 Nov 2023 02:16:45 +0800 Subject: [PATCH] Add multiple PHP versions in test.yml --- .github/workflows/test.yml | 48 ++++++++++++-------------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a32d22ac..9d415a93 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,36 +1,18 @@ -name: Run Test Suite - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -permissions: - contents: read - jobs: - build: - - runs-on: ubuntu-latest - + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + name: Run Unit Test on PHP ${{ matrix.php-versions }} steps: - - uses: actions/checkout@v3 - - - name: Validate composer.json and composer.lock - run: composer validate --strict - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v3 + - name: Checkout + uses: actions/checkout@v2 + - name: Install PHP + uses: shivammathur/setup-php@v2 with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Install dependencies - run: composer install --prefer-dist --no-progress - - - name: Run test suite - run: vendor/bin/phpunit \ No newline at end of file + php-version: ${{ matrix.php-versions }} + extensions: intl #optional + ini-values: "post_max_size=256M" #optional + - name: Check PHP Version + run: php -v \ No newline at end of file