ci: explicitly install subversion
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
SVN is required both for WP test setup and deployment actions, but no longer present on default "ubuntu-latest" environments. Add a step to install it.
This commit is contained in:
parent
0979f070cf
commit
e5a76fc18c
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@ -19,6 +19,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Install SVN
|
||||||
|
run: |
|
||||||
|
if ! command -v svn > /dev/null; then
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y subversion
|
||||||
|
fi
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
|
@ -10,6 +10,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Install SVN
|
||||||
|
run: |
|
||||||
|
if ! command -v svn > /dev/null; then
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y subversion
|
||||||
|
fi
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
|
@ -11,6 +11,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Install SVN
|
||||||
|
run: |
|
||||||
|
if ! command -v svn > /dev/null; then
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y subversion
|
||||||
|
fi
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
|
@ -22,6 +22,17 @@ download() {
|
|||||||
curl -s "$1" > "$2";
|
curl -s "$1" > "$2";
|
||||||
elif [ `which wget` ]; then
|
elif [ `which wget` ]; then
|
||||||
wget -nv -O "$2" "$1"
|
wget -nv -O "$2" "$1"
|
||||||
|
else
|
||||||
|
echo "Error: Neither curl nor wget is installed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if svn is installed
|
||||||
|
check_svn_installed() {
|
||||||
|
if ! command -v svn > /dev/null; then
|
||||||
|
echo "Error: svn is not installed. Please install svn and try again."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,6 +75,7 @@ install_wp() {
|
|||||||
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
|
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
|
||||||
mkdir -p $TMPDIR/wordpress-trunk
|
mkdir -p $TMPDIR/wordpress-trunk
|
||||||
rm -rf $TMPDIR/wordpress-trunk/*
|
rm -rf $TMPDIR/wordpress-trunk/*
|
||||||
|
check_svn_installed
|
||||||
svn export --quiet https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress
|
svn export --quiet https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress
|
||||||
mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR
|
mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR
|
||||||
else
|
else
|
||||||
@ -108,6 +120,7 @@ install_test_suite() {
|
|||||||
# set up testing suite
|
# set up testing suite
|
||||||
mkdir -p $WP_TESTS_DIR
|
mkdir -p $WP_TESTS_DIR
|
||||||
rm -rf $WP_TESTS_DIR/{includes,data}
|
rm -rf $WP_TESTS_DIR/{includes,data}
|
||||||
|
check_svn_installed
|
||||||
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
|
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
|
||||||
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
|
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user