Skip to content

Commit 5143e28

Browse files
committed
Update Node and Fix CI
1 parent 7d469a4 commit 5143e28

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/php-unit-on-pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
# Checkout the repository
2222
- name: Checkout
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424

2525
# PHP setup
2626
- name: Setup PHP ${{ matrix.php }}
@@ -37,22 +37,22 @@ jobs:
3737

3838
# Use node version from .nvmrc
3939
- name: Setup NodeJS
40-
uses: actions/setup-node@v3
40+
uses: actions/setup-node@v4
4141
with:
4242
node-version-file: '.nvmrc'
4343

4444
# Cache composer dependencies
4545
- name: Cache composer dependencies
4646
id: composer-cache
47-
uses: actions/cache@v3
47+
uses: actions/cache@v1
4848
with:
4949
path: ./vendor
5050
key: ${{ runner.os }}-vendor-${{ hashFiles('composer.lock') }}
5151

5252
# Cache node dependencies
5353
- name: Cache node dependencies
5454
id: node-cache
55-
uses: actions/cache@v3
55+
uses: actions/cache@v4
5656
with:
5757
path: ./node_modules
5858
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
@@ -76,7 +76,7 @@ jobs:
7676
# Prepare test environment
7777
- name: Prepare test environment
7878
run: |
79-
bash tests/bin/install-phpunit-tests-dependencies.sh wc_apa_test root root 127.0.0.1 latest
79+
bash tests/bin/install-phpunit-tests-dependencies.sh wc_apa_test root root 127.0.0.1 latest ${{ matrix.php }}
8080
8181
# Run tests
8282
- name: Run tests

tests/bin/install-phpunit-tests-dependencies.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ DB_USER=$2
1111
DB_PASS=$3
1212
DB_HOST=${4-localhost}
1313
WP_VERSION=${5-latest}
14+
PHP_VERSION=$6
1415

1516
TMPDIR=${TMPDIR-/tmp}
1617
TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//")
@@ -62,9 +63,14 @@ install_wp() {
6263
}
6364

6465
install_woocommerce() {
65-
WC_VERSION=$(curl https://api.wordpress.org/plugins/info/1.0/woocommerce.json | jq -r '.version')
66+
if [ $PHP_VERSION = "7.3" ]; then
67+
WC_VERSION="8.4.0"
68+
echo "Warning: WooCommerce $WC_VERSION is the latest version compatible with PHP7.3"
69+
else
70+
WC_VERSION=$(curl https://api.wordpress.org/plugins/info/1.0/woocommerce.json | jq -r '.version')
71+
fi
6672

67-
echo "Installing WooCommerce $WC_VERSION"
73+
echo "Installing WooCommerce $WC_VERSION on PHP $PHP_VERSION"
6874
cd -
6975
download https://downloads.wordpress.org/plugin/woocommerce.$WC_VERSION.zip ../woocommerce.zip
7076
unzip -o -qq ../woocommerce.zip -d ../

0 commit comments

Comments
 (0)