-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Refactor GitHub Actions workflows #6946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: PHPUnit with Db2 | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| php-version: | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| phpunit-db2: | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| services: | ||
| db2: | ||
| image: icr.io/db2_community/db2:11.5.8.0 | ||
| ports: | ||
| - '50000:50000' | ||
| env: | ||
| DB2INSTANCE: db2inst1 | ||
| DB2INST1_PASSWORD: Doctrine2018 | ||
| LICENSE: accept | ||
| DBNAME: doctrine | ||
| options: >- | ||
| --health-cmd "su - ${DB2INSTANCE} -c \"db2 -t CONNECT TO ${DBNAME};\"" | ||
| --health-interval 30s | ||
| --health-timeout 10s | ||
| --health-retries 5 | ||
| --privileged | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install IBM DB2 CLI driver | ||
| working-directory: /tmp | ||
| run: | | ||
| wget https://github.com/ibmdb/db2drivers/raw/refs/heads/main/clidriver/v11.5.9/linuxx64_odbc_cli.tar.gz | ||
| tar xf linuxx64_odbc_cli.tar.gz | ||
| rm linuxx64_odbc_cli.tar.gz | ||
|
|
||
| - name: Install PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ inputs.php-version }} | ||
| extensions: ibm_db2 | ||
| coverage: pcov | ||
| ini-values: zend.assertions=1 | ||
| env: | ||
| IBM_DB2_CONFIGURE_OPTS: '--with-IBM_DB2=/tmp/clidriver' | ||
|
|
||
| - name: Install dependencies with Composer | ||
| uses: ramsey/composer-install@v3 | ||
| with: | ||
| composer-options: '--ignore-platform-req=php+' | ||
|
|
||
| - name: Create temporary tablespace | ||
| run: docker exec "${{ job.services.db2.id }}" su - db2inst1 -c "db2 -t CONNECT TO doctrine; db2 -t CREATE USER TEMPORARY TABLESPACE doctrine_tbsp PAGESIZE 4 K" | ||
|
|
||
| - name: Run PHPUnit | ||
| run: vendor/bin/phpunit -c ci/github/phpunit/ibm_db2.xml --coverage-clover=coverage.xml | ||
|
|
||
| - name: Upload coverage file | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ github.job }}-php-${{ inputs.php-version }}.coverage | ||
| path: coverage.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: PHPUnit with MariaDB | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| php-version: | ||
| required: true | ||
| type: string | ||
| mariadb-version: | ||
| required: true | ||
| type: string | ||
| extension: | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| phpunit-mariadb: | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| services: | ||
| mariadb: | ||
| image: mariadb:${{ inputs.mariadb-version }} | ||
| ports: | ||
| - '3306:3306' | ||
| env: | ||
| MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' | ||
| MYSQL_DATABASE: doctrine_tests | ||
| options: >- | ||
| --health-cmd "healthcheck.sh --connect --innodb_initialized || mysqladmin ping --protocol tcp --silent" | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ inputs.php-version }} | ||
| extensions: ${{ inputs.extension }} | ||
| coverage: pcov | ||
| ini-values: zend.assertions=1 | ||
|
|
||
| - name: Install dependencies with Composer | ||
| uses: ramsey/composer-install@v3 | ||
| with: | ||
| composer-options: '--ignore-platform-req=php+' | ||
|
|
||
| - name: Run PHPUnit | ||
| run: vendor/bin/phpunit -c ci/github/phpunit/${{ inputs.extension }}${{ inputs.config-file-suffix }}.xml --coverage-clover=coverage.xml | ||
|
|
||
| - name: Upload coverage file | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ github.job }}-${{ inputs.mariadb-version }}-php-${{ inputs.php-version }}-${{ inputs.extension }}.coverage | ||
| path: coverage.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: PHPUnit with MySQL | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| php-version: | ||
| required: true | ||
| type: string | ||
| mysql-version: | ||
| required: true | ||
| type: string | ||
| extension: | ||
| required: true | ||
| type: string | ||
| config-file-suffix: | ||
| required: false | ||
| type: string | ||
| default: '' | ||
|
|
||
| jobs: | ||
| phpunit-mysql: | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| services: | ||
| mysql: | ||
| image: mysql:${{ inputs.mysql-version }} | ||
| ports: | ||
| - '3306:3306' | ||
| env: | ||
| MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' | ||
| MYSQL_DATABASE: doctrine_tests | ||
| options: >- | ||
| --health-cmd "mysqladmin ping --silent" | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ inputs.php-version }} | ||
| extensions: ${{ inputs.extension }} | ||
| coverage: pcov | ||
| ini-values: zend.assertions=1 | ||
|
|
||
| - name: Install dependencies with Composer | ||
| uses: ramsey/composer-install@v3 | ||
| with: | ||
| composer-options: '--ignore-platform-req=php+' | ||
|
|
||
| - name: Copy TLS-related files | ||
| run: docker cp "${{ job.services.mysql.id }}:/var/lib/mysql/ca.pem" . && docker cp "${{ job.services.mysql.id }}:/var/lib/mysql/client-cert.pem" . && docker cp "${{ job.services.mysql.id }}:/var/lib/mysql/client-key.pem" . | ||
| if: ${{ endsWith(inputs.config-file-suffix, 'tls') }} | ||
|
|
||
| - name: Run PHPUnit | ||
| run: vendor/bin/phpunit -c ci/github/phpunit/${{ inputs.extension }}${{ inputs.config-file-suffix }}.xml --coverage-clover=coverage.xml | ||
|
|
||
| - name: Upload coverage file | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ github.job }}-${{ inputs.mysql-version }}-php-${{ inputs.php-version }}-${{ inputs.extension }}${{ inputs.config-file-suffix }}.coverage | ||
| path: coverage.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: PHPUnit with Oracle | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| php-version: | ||
| required: true | ||
| type: string | ||
| oracle-version: | ||
| required: true | ||
| type: string | ||
| extension: | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| phpunit-oracle: | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| services: | ||
| oracle: | ||
| image: gvenzl/oracle-${{ inputs.oracle-version < 23 && 'xe' || 'free' }}:${{ inputs.oracle-version }} | ||
| ports: | ||
| - '1521:1521' | ||
| env: | ||
| ORACLE_PASSWORD: oracle | ||
| options: >- | ||
| --health-cmd healthcheck.sh | ||
| --health-interval 20s | ||
| --health-timeout 10s | ||
| --health-retries 10 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ inputs.php-version }} | ||
| extensions: ${{ inputs.extension }} | ||
| coverage: pcov | ||
| ini-values: zend.assertions=1 | ||
|
|
||
| - name: Install dependencies with Composer | ||
| uses: ramsey/composer-install@v3 | ||
| with: | ||
| composer-options: '--ignore-platform-req=php+' | ||
|
|
||
| - name: Run PHPUnit | ||
| run: vendor/bin/phpunit -c ci/github/phpunit/${{ inputs.extension }}${{ inputs.oracle-version < 23 && '-21' || '' }}.xml --coverage-clover=coverage.xml | ||
|
|
||
| - name: Upload coverage file | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ github.job }}-${{ inputs.oracle-version }}-php-${{ inputs.php-version }}-${{ inputs.extension }}.coverage | ||
| path: coverage.xml |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this use the
nightlykeyword to reduce maintenance work for that workflow ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's the same, yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the difference is that
nightlywill automatically mean PHP 8.6 after the release of PHP 8.5.0 (it always refers to themasterbranch of PHP).Actually,
8.5currently installs the nightly PHP version as 8.5 is not released yet: https://github.com/shivammathur/setup-php?tab=readme-ov-file#tada-php-supportto me,
nightlyis exactly the intent we want in thisnightly.ymljob, to avoid having to remember to update it every year.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that was my understanding. Using
nightlysounds good. It's more expressive and requires less maintenance.