Skip to content

Commit

Permalink
Merge release/6.5.0 into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarcosta99 committed Sep 21, 2023
2 parents d169784 + 654a7a9 commit efd9c5a
Show file tree
Hide file tree
Showing 281 changed files with 8,700 additions and 2,417 deletions.
8 changes: 2 additions & 6 deletions .github/actions/e2e/env-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ runs:
run: echo -e "machine github.com\n login $E2E_GH_TOKEN" > ~/.netrc

# PHP setup
- name: PHP Setup
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
coverage: none
- name: "Set up PHP"
uses: ./.github/actions/setup-php

# Composer setup
- name: Setup Composer
Expand Down
19 changes: 19 additions & 0 deletions .github/actions/setup-php/action.yml
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
19 changes: 5 additions & 14 deletions .github/actions/setup-repo/action.yml
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
2 changes: 1 addition & 1 deletion .github/workflows/build-zip-and-run-smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
jobs:
build-zip:
name: "Build the zip file"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/check-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
jobs:
check-changelog:
name: Check changelog
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
# clone the repository
- uses: actions/checkout@v3
Expand All @@ -22,11 +22,8 @@ jobs:
path: ~/.cache/composer/
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
# setup PHP, but without debug extensions for reasonable performance
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
coverage: none
- name: "Set up PHP"
uses: ./.github/actions/setup-php
# Install composer packages.
- run: composer self-update && composer install --no-progress
# Fetch the target branch before running the check.
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:
jobs:
generate-wc-compat-matrix:
name: "Generate the matrix for woocommerce compatibility dynamically"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
Expand All @@ -29,7 +29,7 @@ jobs:
woocommerce-compatibility:
name: "WC compatibility"
needs: generate-wc-compat-matrix
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
WP_VERSION: ${{ matrix.wordpress }}
WC_VERSION: ${{ matrix.woocommerce }}
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:

generate-wc-compat-beta-matrix:
name: "Generate the matrix for compatibility-woocommerce-beta dynamically"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
Expand All @@ -71,7 +71,7 @@ jobs:
compatibility-woocommerce-beta:
name: Environment - WC beta
needs: generate-wc-compat-beta-matrix
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.generate-wc-compat-beta-matrix.outputs.matrix) }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
jobs:
woocommerce-coverage:
name: Code coverage
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defaults:
jobs:
create-release:
name: "Create the pre-release"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ inputs.releaseVersion }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ concurrency:

jobs:
wcpay-e2e-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

strategy:
fail-fast: false
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ env:
jobs:
generate-matrix:
name: "Generate the matrix for subscriptions-tests dynamically"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
Expand All @@ -42,7 +42,7 @@ jobs:
# Run WCPay & subscriptions tests against specific WC versions
wcpay-subscriptions-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: generate-matrix
strategy:
fail-fast: false
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
# Run tests against WC Checkout blocks & WC latest
# [TODO] Unskip blocks tests after investigating constant failures.
# blocks-tests:
# runs-on: ubuntu-20.04
# runs-on: ubuntu-latest
# name: WC - latest | blocks - shopper

# env:
Expand All @@ -93,7 +93,7 @@ jobs:

# Run tests against WP Nightly & WC latest
wp-nightly-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

strategy:
fail-fast: false
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/i18n-weekly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
i18n-release:
name: Release
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
# clone the repository
Expand All @@ -27,12 +27,8 @@ jobs:
path: ~/.npm/
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
# setup PHP, but without debug extensions for reasonable performance
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
coverage: none

- name: "Set up PHP"
uses: ./.github/actions/setup-php
- name: Build release
run: |
npm ci
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/js-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
jobs:
lint:
name: JS linting
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
# clone the repository
- uses: actions/checkout@v3
Expand All @@ -32,7 +32,7 @@ jobs:

test:
name: JS testing
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
# clone the repository
- uses: actions/checkout@v3
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/php-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ jobs:
# Check for version-specific PHP compatibility
php-compatibility:
name: PHP Compatibility
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
coverage: none
- name: "Set up PHP"
uses: ./.github/actions/setup-php
- run: bash bin/phpcs-compat.sh
13 changes: 5 additions & 8 deletions .github/workflows/php-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:
jobs:
lint:
name: PHP linting
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
# clone the repository
- uses: actions/checkout@v3
Expand All @@ -27,17 +27,14 @@ jobs:
path: ~/.cache/composer/
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
# setup PHP, but without debug extensions for reasonable performance
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer
coverage: none
- name: "Set up PHP"
uses: ./.github/actions/setup-php
# install dependencies and run linter
- run: composer self-update && composer install --no-progress && ./vendor/bin/phpcs --standard=phpcs.xml.dist $(git ls-files | grep .php$) && ./vendor/bin/psalm

generate-test-matrix:
name: "Generate the matrix for php tests dynamically"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
Expand All @@ -50,7 +47,7 @@ jobs:
test:
name: PHP testing
needs: generate-test-matrix
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 10
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/post-release-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defaults:
jobs:
get-last-released-version:
name: "Get the last released version"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
releaseVersion: ${{ steps.current-version.outputs.RELEASE_VERSION }}

Expand All @@ -31,7 +31,7 @@ jobs:
create-gh-release:
name: "Create a GH release"
needs: get-last-released-version
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ needs.get-last-released-version.outputs.releaseVersion }}

Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
merge-trunk-into-develop:
name: "Merge trunk back into develop"
needs: get-last-released-version
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ needs.get-last-released-version.outputs.releaseVersion }}

Expand All @@ -98,7 +98,7 @@ jobs:
trigger-translations:
name: "Trigger translations update for the release"
needs: [ get-last-released-version, create-gh-release ]
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: "Checkout repository (trunk)"
uses: actions/checkout@v3
Expand All @@ -114,7 +114,7 @@ jobs:
update-wiki:
name: "Update the wiki for the next release"
needs: get-last-released-version
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ needs.get-last-released-version.outputs.releaseVersion }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-build-live-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
jobs:
build-and-inform-zip-file:
name: "Build and inform the zip file"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ defaults:
jobs:
process-changelog:
name: "Process the changelog"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
CHANGELOG_ACTION: ${{ inputs.action-type }}
RELEASE_VERSION: ${{ inputs.release-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-code-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defaults:
jobs:
check-code-freeze:
name: "Check that today is the day of the code freeze"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
freeze: ${{ steps.check-freeze.outputs.FREEZE }}
nextReleaseVersion: ${{ steps.next-version.outputs.NEXT_RELEASE_VERSION }}
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
name: "Send notification to Slack"
needs: [check-code-freeze, create-release-pr]
if: ${{ ! ( inputs.skipSlackPing && needs.create-release-pr.outputs.release-pr-id ) }}
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ needs.check-code-freeze.outputs.nextReleaseVersion }}
RELEASE_DATE: ${{ needs.check-code-freeze.outputs.nextReleaseDate }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ defaults:
jobs:
prepare-release:
name: "Prepare a stable release"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.create_branch.outputs.branch-name }}
release-pr-id: ${{ steps.create-pr-to-trunk.outputs.RELEASE_PR_ID }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ We currently support the following variables:

## Test account setup

For setting up a test account follow [these instructions](https://woocommerce.com/document/woocommerce-payments/testing-and-troubleshooting/dev-mode/).
For setting up a test account follow [these instructions](https://woocommerce.com/document/woopayments/testing-and-troubleshooting/dev-mode/).

You will need a externally accessible URL to set up the plugin. You can use ngrok for this.

Expand Down
Loading

0 comments on commit efd9c5a

Please sign in to comment.