Changeset 57218 for trunk/.github/workflows/install-testing.yml
- Timestamp:
- 12/22/2023 12:58:26 AM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/install-testing.yml
r57197 r57218 1 # Confirms that installing WordPress using WP-CLI works successfully. 2 # 3 # This workflow is not meant to test wordpress-develop checkouts, but rather tagged versions officially available on WordPress.org. 1 4 name: Installation Tests 2 5 … … 12 15 paths: 13 16 - '.github/workflows/install-testing.yml' 17 schedule: 18 - cron: '0 0 * * 1' 14 19 workflow_dispatch: 15 20 inputs: … … 17 22 description: 'The version to test installing. Accepts major and minor versions, "latest", or "nightly". Major releases must not end with ".0".' 18 23 type: string 19 default: ' latest'24 default: 'nightly' 20 25 21 26 # Cancels all previous workflow runs for pull requests that have not completed. … … 23 28 # The concurrency group contains the workflow name and the branch name for pull requests 24 29 # or the commit hash for any other events. 25 group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}30 group: ${{ github.workflow }}-${{ inputs.wp-version || github.event_name == 'pull_request' && github.head_ref || github.sha }} 26 31 cancel-in-progress: true 27 32 … … 31 36 32 37 jobs: 38 # Determines the appropriate values for PHP and database versions based on the WordPress version being tested. 39 # 40 # Performs the following steps: 41 # - Checks out the repository. 42 # - Fetches the versions of PHP to test. 43 # - Fetches the versions of MySQL to test. 44 build-matrix: 45 name: Determine PHP Versions to test 46 runs-on: ubuntu-latest 47 timeout-minutes: 5 48 outputs: 49 major-wp-version: ${{ steps.major-wp-version.outputs.version }} 50 php-versions: ${{ steps.php-versions.outputs.versions }} 51 mysql-versions: ${{ steps.mysql-versions.outputs.versions }} 52 53 steps: 54 - name: Checkout repository 55 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 56 with: 57 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 58 59 - name: Determine the major WordPress version 60 id: major-wp-version 61 run: | 62 if [ "${{ inputs.wp-version }}" ] && [ "${{ inputs.wp-version }}" != "nightly" ] && [ "${{ inputs.wp-version }}" != "latest" ]; then 63 echo "version=$(echo "${{ inputs.wp-version }}" | tr '.' '-' | cut -d '-' -f1-2)" >> $GITHUB_OUTPUT 64 elif [ "${{ inputs.wp-version }}" ]; then 65 echo "version=$(echo "${{ inputs.wp-version }}")" >> $GITHUB_OUTPUT 66 else 67 echo "version=nightly" >> $GITHUB_OUTPUT 68 fi 69 70 # Look up the major version's specific PHP support policy when a version is provided. 71 # Otherwise, use the current PHP support policy. 72 - name: Get supported PHP versions 73 id: php-versions 74 run: | 75 if [ "${{ steps.major-wp-version.outputs.version }}" != "latest" ] && [ "${{ steps.major-wp-version.outputs.version }}" != "nightly" ]; then 76 echo "versions=$(jq -r '.["${{ steps.major-wp-version.outputs.version }}"] | @json' .version-support-php.json)" >> $GITHUB_OUTPUT 77 else 78 echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-php.json)" >> $GITHUB_OUTPUT 79 fi 80 81 # Look up the major version's specific MySQL support policy when a version is provided. 82 # Otherwise, use the current MySQL support policy. 83 - name: Get supported MySQL versions 84 id: mysql-versions 85 run: | 86 if [ "${{ steps.major-wp-version.outputs.version }}" != "latest" ] && [ "${{ steps.major-wp-version.outputs.version }}" != "nightly" ]; then 87 echo "versions=$(jq -r '.["${{ steps.major-wp-version.outputs.version }}"] | @json' .version-support-mysql.json)" >> $GITHUB_OUTPUT 88 else 89 echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-mysql.json)" >> $GITHUB_OUTPUT 90 fi 91 33 92 # Test the WordPress installation process through WP-CLI. 34 93 # … … 40 99 # - Installs WordPress. 41 100 install-tests-mysql: 42 name: WP ${{ inputs.wp-version || ' latest' }} / PHP ${{ matrix.php }} / ${{ 'mariadb' == matrix.db-type && 'MariaDB' || 'MySQL' }} ${{ matrix.db-version }}${{ matrix.multisite && ' multisite' || '' }}101 name: WP ${{ inputs.wp-version || 'nightly' }} / PHP ${{ matrix.php }} / ${{ 'mariadb' == matrix.db-type && 'MariaDB' || 'MySQL' }} ${{ matrix.db-version }}${{ matrix.multisite && ' multisite' || '' }} 43 102 permissions: 44 103 contents: read 45 runs-on: ubuntu-latest104 runs-on: ${{ matrix.os }} 46 105 timeout-minutes: 10 106 needs: [ build-matrix ] 47 107 strategy: 48 108 fail-fast: false 49 109 matrix: 50 110 os: [ ubuntu-latest ] 51 php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]111 php: ${{ fromJSON( needs.build-matrix.outputs.php-versions ) }} 52 112 db-type: [ 'mysql' ] 53 db-version: [ '5.7', '8.0' ]113 db-version: ${{ fromJSON( needs.build-matrix.outputs.mysql-versions ) }} 54 114 multisite: [ false, true ] 115 memcached: [ false ] 116 117 # Exclude some PHP and MySQL versions that cannot currently be tested with Docker containers. 118 exclude: 119 - php: '5.2' 120 - php: '5.3' 121 - db-version: '5.0' 122 - db-version: '5.1' 123 - db-version: '5.5' 55 124 56 125 services: … … 59 128 ports: 60 129 - 3306 61 options: --health-cmd="mysqladmin ping" --health-interval=30s --health-timeout=10s --health-retries=5 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=test_db --entrypoint sh ${{ matrix.db-type }}:${{ matrix.db-version }} -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" 130 options: >- 131 --health-cmd="mysqladmin ping" 132 --health-interval=30s 133 --health-timeout=10s 134 --health-retries=5 135 -e MYSQL_ROOT_PASSWORD=root 136 -e MYSQL_DATABASE=test_db 137 --entrypoint sh ${{ matrix.db-type }}:${{ matrix.db-version }} 138 -c "exec docker-entrypoint.sh mysqld${{ matrix.db-version != '5.5' && ' --default-authentication-plugin=mysql_native_password"' || '' }} 62 139 63 140 steps: … … 67 144 php-version: '${{ matrix.php }}' 68 145 coverage: none 69 tools: wp-cli 146 tools: wp-cli${{ contains( fromJSON('["5.4", "5.5"]'), matrix.php ) && ':2.4.0' || '' }} 70 147 71 148 - name: Start the database server … … 74 151 75 152 - name: Download WordPress 76 run: wp core download ${{ inputs.wp-version && 'latest' != inputs.wp-version && format( '--version={0}', inputs.wp-version ) || '' }}153 run: wp core download ${{ inputs.wp-version && format( '--version={0}', inputs.wp-version ) || '--version=nightly' }} 77 154 78 155 - name: Create wp-config.php file
Note: See TracChangeset
for help on using the changeset viewer.