Skip to content

Commit

Permalink
start adding new github action
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Oct 24, 2023
1 parent 14afc40 commit 71c902d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,29 @@ jobs:
shell: bash
run: cd ${{ github.workspace }}/wp-content/plugins/matomo && WP_MULTISITE=1 ./vendor/bin/phpunit

e2e_tests:
runs-on: 'ubuntu-22.04'
strategy:
fail-fast: false
matrix:
wp-versions: [ 'latest', 'trunk' ] # TODO
php-versions: [ '7.2', '8.1' ]
permissions:
contents: read # <--- allows to read repo
steps:
# setup firefox
- uses: browser-actions/setup-firefox@v1
- run: firefox --version

# create .env file
# TODO

# start local environment via docker-compose
# TODO

# run tests
# TODO

checkstyle:
runs-on: 'ubuntu-20.04'
steps:
Expand Down Expand Up @@ -137,5 +160,3 @@ jobs:
- name: Run checkstyle
shell: bash
run: cd ${{ github.workspace }}/wp-content/plugins/matomo && ./vendor/bin/phpcs


11 changes: 9 additions & 2 deletions scripts/local-dev-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ chmod +x /var/www/html/wp-cli.phar
WORDPRESS_VERSION=${WORDPRESS_VERSION:-$LATEST_WORDPRESS_VERSION}
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.tar.gz"
WORDPRESS_URL="https://wordpress.org/wordpress-$WORDPRESS_VERSION.zip"
if [ "$WORDPRESS_FOLDER" = "trunk" ]; then
WORDPRESS_URL="https://wordpress.org/nightly-builds/wordpress-latest.zip"
fi

echo "installing wordpress $WORDPRESS_VERSION from $WORDPRESS_URL to /var/www/html/$WORDPRESS_FOLDER/..."

curl -O "$WORDPRESS_URL"
tar -xvf "wordpress-$WORDPRESS_VERSION.tar.gz"

unzip -q "wordpress-$WORDPRESS_VERSION.tar.gz"
mv wordpress "$WORDPRESS_FOLDER"

echo "wordpress installed!"
Expand Down

0 comments on commit 71c902d

Please sign in to comment.