-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract minimum supported PHP version from plugin file for GH actions (…
- Loading branch information
1 parent
8aa1e68
commit 384ca6d
Showing
8 changed files
with
38 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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 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,19 @@ | ||
name: "Set up PHP" | ||
description: "Extracts the required PHP version from plugin file and uses it to build PHP." | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: "Get minimum PHP version" | ||
shell: bash | ||
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 | ||
with: | ||
php-version: ${{ steps.get_min_php_version.outputs.MIN_PHP_VERSION }} | ||
tools: composer | ||
coverage: none |
This file contains 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 |
---|---|---|
@@ -1,29 +1,20 @@ | ||
name: "Setup WooCommerce Payments repository" | ||
description: "Handles the installation, building, and caching of the projects within the repository." | ||
|
||
inputs: | ||
php-version: | ||
description: "The version of PHP that the action should set up." | ||
default: "7.4" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- 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: "Setup PHP" | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ inputs.php-version }} | ||
tools: composer | ||
coverage: none | ||
|
||
- name: "Set up PHP" | ||
uses: ./.github/actions/setup-php |
This file contains 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 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 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 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 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,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Comment: Update GH workflows to use PHP version from plugin file. |