From 4d4c9f9308c92e96fd47315126662d3c710e93b6 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 20 Nov 2024 10:44:20 +0900 Subject: [PATCH] Add optional Windows and Ubuntu lowest tests to CI Updated the CI workflow to include optional tests on Windows and the Ubuntu lowest environment. Also upgraded actions/checkout and actions/cache versions to v4. --- .github/workflows/continuous-integration.yml | 43 +++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 593625b..b4d3806 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -18,6 +18,16 @@ on: required: false type: string default: '8.4' + windows: + description: Run tests on Windows + required: false + type: boolean + default: false + ubuntu_lowest: + description: Run tests on ubuntu-lowest environment + required: false + type: boolean + default: false script: description: Additional scripts to run required: false @@ -30,35 +40,37 @@ env: jobs: phpunit: name: PHPUnit - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: + php-version: ${{ fromJson(inputs.old_stable) }} + dependencies: [highest, lowest] + os: [ubuntu-latest] include: - # Old stable versions - - php-version: ${{ fromJson(inputs.old_stable) }} - os: ubuntu-latest - dependencies: highest - - php-version: ${{ fromJson(inputs.old_stable) }} - os: ubuntu-latest - dependencies: lowest - # Current stable version - php-version: ${{ inputs.current_stable }} - os: windows-latest + os: ubuntu-latest dependencies: highest experimental: false - - php-version: ${{ inputs.current_stable }} - os: ubuntu-latest + + # Windows test (optional) + - if: ${{ inputs.windows }} + php-version: ${{ inputs.current_stable }} + os: windows-latest dependencies: highest experimental: false - - php-version: ${{ inputs.current_stable }} + + # Ubuntu lowest test (optional) + - if: ${{ inputs.ubuntu_lowest }} + php-version: ${{ inputs.current_stable }} os: ubuntu-lowest - dependencies: lowest + dependencies: highest experimental: false steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -71,6 +83,7 @@ jobs: - name: Get composer cache directory id: composer-cache + shell: bash run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies