I'm trying to get my unit-tests to run via GitHub Actions on a pull_request.
I can see the actions running when I update my PR but the PHP version doesn't update when it tries to composer install my project.
Command: composer install --no-interaction --no-suggest --no-progress
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- This package requires php ~7.3.0 but your PHP version (7.4.10) does not satisfy that requirement.
I've tried multiple different workflow files, and this was the one that gave me the most control, but it still seems to be running on php 7.4.
name: Run Tests
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.3']
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- uses: php-actions/composer@v2
- uses: php-actions/phpunit@v8
Finally, here is the snippet from my composer json that shows the constraint:
"require": {
"php": "~7.3.0",
"guzzlehttp/guzzle": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^8"
}
PHP Switched to PHP 7.3.22php-actions/composer@v2) knows which PHP version to use? As far as I see, it uses a different container