Make WordPress Core


Ignore:
Timestamp:
02/17/2023 07:51:16 AM (3 years ago)
Author:
desrosj
Message:

Build/Test Tools: Backport updates to GitHub Actions.

This backports updates to GitHub Actions workflows required to address deprecated notices related to save-output and set-output.

Merges [54650], [54750], [54851], [54852], [54856], and [55152] to the 6.1 branch.
See #56882, #56820.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/6.1/.github/workflows/phpunit-tests.yml

    r54680 r55357  
    3737  # Performs the following steps:
    3838  # - Sets environment variables.
    39   # - Sets up the environment variables needed for testing with memcached (if desired).
    40   # - Installs NodeJS.
    41   # - Installs NPM dependencies
    42   # - Configures caching for Composer.
     39  # - Checks out the repository.
     40  # - Sets up Node.js.
     41  # - Sets up PHP.
    4342  # - Installs Composer dependencies.
     43  # - Installs npm dependencies
     44  # - Logs general debug information about the runner.
    4445  # - Logs Docker debug information (about the Docker installation within the runner).
    4546  # - Starts the WordPress Docker container.
    46   # - Logs general debug information about the runner.
    4747  # - Logs the running Docker containers.
    48   # - Logs debug information from inside the WordPress Docker container.
    4948  # - Logs debug information about what's installed within the WordPress Docker containers.
    5049  # - Install WordPress within the Docker container.
     
    5251  # - Ensures version-controlled files are not modified or deleted.
    5352  # - Checks out the WordPress Test reporter repository.
    54   # - Reconnect the directory to the Git repository.
    5553  # - Submit the test results to the WordPress.org host test results.
    5654  test-php:
     
    107105
    108106      - name: Checkout repository
    109         uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
    110 
    111       - name: Install NodeJS
    112         uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
     107        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
     108
     109      - name: Set up Node.js
     110        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    113111        with:
    114112          node-version-file: '.nvmrc'
    115113          cache: npm
    116114
    117       - name: Install Dependencies
     115      ##
     116      # This allows Composer dependencies to be installed using a single step.
     117      #
     118      # Since the tests are currently run within the Docker containers where the PHP version varies,
     119      # the same PHP version needs to be configured for the action runner machine so that the correct
     120      # dependency versions are installed and cached.
     121      ##
     122      - name: Set up PHP
     123        uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc # v2.23.0
     124        with:
     125          php-version: '${{ matrix.php }}'
     126          coverage: none
     127
     128      # Since Composer dependencies are installed using `composer update` and no lock file is in version control,
     129      # passing a custom cache suffix ensures that the cache is flushed at least once per week.
     130      - name: Install Composer dependencies
     131        uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
     132        with:
     133          custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")
     134
     135      - name: Install npm dependencies
    118136        run: npm ci
    119 
    120       # This date is used to ensure that the Composer cache is refreshed at least once every week.
    121       # http://man7.org/linux/man-pages/man1/date.1.html
    122       - name: "Get last Monday's date"
    123         id: get-date
    124         run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
    125 
    126       - name: Get Composer cache directory
    127         id: composer-cache
    128         run: echo "composer_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
    129 
    130       - name: Cache Composer dependencies
    131         uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
    132         env:
    133           cache-name: cache-composer-dependencies
    134         with:
    135           path: ${{ steps.composer-cache.outputs.composer_dir }}
    136           key: ${{ runner.os }}-php-${{ matrix.php }}-date-${{ steps.get-date.outputs.date }}-composer-${{ hashFiles('**/composer.json') }}
    137 
    138       - name: Install Composer dependencies
    139         run: |
    140           docker-compose run --rm php composer --version
    141 
    142           # Install using `composer update` as there is no `composer.lock` file.
    143           if [ ${{ env.LOCAL_PHP }} == '8.2-fpm' ]; then
    144             docker-compose run --rm php composer update --ignore-platform-req=php+
    145           else
    146             docker-compose run --rm php composer update
    147           fi
    148 
    149       - name: Docker debug information
    150         run: |
    151           docker -v
    152           docker-compose -v
    153 
    154       - name: Start Docker environment
    155         run: |
    156           npm run env:start
    157137
    158138      - name: General debug information
     
    163143          git --version
    164144          svn --version
     145          composer --version
     146          locale -a
     147
     148      - name: Docker debug information
     149        run: |
     150          docker -v
     151          docker-compose -v
     152
     153      - name: Start Docker environment
     154        run: |
     155          npm run env:start
    165156
    166157      - name: Log running Docker containers
     
    217208      - name: Checkout the WordPress Test Reporter
    218209        if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }}
    219         uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
     210        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    220211        with:
    221212          repository: 'WordPress/phpunit-test-runner'
     
    256247    steps:
    257248      - name: Dispatch workflow run
    258         uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.3.2
     249        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
    259250        with:
    260251          retries: 2
Note: See TracChangeset for help on using the changeset viewer.