Skip to content

Commit

Permalink
Extract minimum supported PHP version from plugin file for GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakpathania committed Sep 12, 2023
1 parent 16d8da6 commit 1e9945a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/actions/setup-repo/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,26 @@ runs:
- name: "Setup Node"
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
node-version-file: ".nvmrc"
cache: "npm"

- name: "Enable composer dependencies caching"
uses: actions/cache@v3
with:
path: ~/.cache/composer/
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}


- name: "Get minimum PHP version"
id: get_min_php_version
run: |
MIN_PHP_VERSION=$(sed -n 's/.*PHP: //p' woocommerce-payments.php)
echo "MIN_PHP_VERSION=$MIN_PHP_VERSION" >> $GITHUB_OUTPUT
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
env:
MIN_PHP_VERSION: ${{ steps.get_min_php_version.outputs.MIN_PHP_VERSION }}
with:
php-version: ${{ inputs.php-version }}
php-version: $MIN_PHP_VERSION
tools: composer
coverage: none

0 comments on commit 1e9945a

Please sign in to comment.