Skip to content

Commit

Permalink
add wdio tests as github action
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Oct 24, 2023
1 parent 71c902d commit a0ee3ef
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
35 changes: 29 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,46 @@ jobs:
strategy:
fail-fast: false
matrix:
wp-versions: [ 'latest', 'trunk' ] # TODO
wp-versions: [ 'latest', 'trunk' ]
php-versions: [ '7.2', '8.1' ]
permissions:
contents: read # <--- allows to read repo
steps:
- uses: actions/checkout@v3
with:
lfs: true
persist-credentials: false

# setup firefox
- uses: browser-actions/setup-firefox@v1
- run: firefox --version

# create .env file
# TODO
# setup node
- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
cache-dependency-path: '**/package-lock.json'

# start local environment via docker-compose
# TODO
# docker-compose up
- uses: isbang/[email protected]
with:
services: wordpress
env:
PHP_VERSION: ${{ matrix.php-versions }}
WOOCOMMERCE: 1
WORDPRESS_FOLDER: test
RESET_DATABASE: 1
WORDPRESS_VERSION: ${{ matrix.wp-versions }}

# run tests
# TODO
- run: npm run wdio
env:
PHP_VERSION: ${{ matrix.php-versions }}
WOOCOMMERCE: 1
WORDPRESS_FOLDER: test
RESET_DATABASE: 1
WORDPRESS_VERSION: ${{ matrix.wp-versions }}

checkstyle:
runs-on: 'ubuntu-20.04'
Expand Down
6 changes: 4 additions & 2 deletions scripts/local-dev-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ chmod +x /var/www/html/wp-cli.phar

# TODO: switch download to use wp-cli instead of just curling (also can use wp db create instead of raw php)
# install wordpress if not present
WORDPRESS_VERSION=${WORDPRESS_VERSION:-$LATEST_WORDPRESS_VERSION}
if [[ "$WORDPRESS_VERSION" = "latest" || -z "$WORDPRESS_VERSION" ]]; then
WORDPRESS_VERSION="$LATEST_WORDPRESS_VERSION"
fi
WORDPRESS_FOLDER=${WORDPRESS_FOLDER:-$WORDPRESS_VERSION}

# TODO: handle trunk ()

if [ ! -d "/var/www/html/$WORDPRESS_FOLDER" ]; then
WORDPRESS_URL="https://wordpress.org/wordpress-$WORDPRESS_VERSION.zip"
if [ "$WORDPRESS_FOLDER" = "trunk" ]; then
if [ "$WORDPRESS_VERSION" = "trunk" ]; then
WORDPRESS_URL="https://wordpress.org/nightly-builds/wordpress-latest.zip"
fi

Expand Down

0 comments on commit a0ee3ef

Please sign in to comment.