Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/testing and ci config #42

Merged
merged 30 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
06812b0
chore: Codeception tests heavily refactored
kidunot89 Feb 18, 2022
23685bd
Enabling test execution using tric
borkweb Feb 18, 2022
d219fb9
Add events-pro to tests
borkweb Feb 18, 2022
b5518b9
chore: GA CI workflow added.
kidunot89 Mar 9, 2022
6c1ca65
chore: GA CI workflow updated.
kidunot89 Mar 10, 2022
cde57bf
chore: GA CI workflow updated.
kidunot89 Mar 10, 2022
6755234
chore: GA CI workflow updated.
kidunot89 Mar 10, 2022
1a7af67
devops: TicketQueriesTest implemented.
kidunot89 Mar 31, 2022
88e1f52
devops: TicketQueriesTest passing
kidunot89 Apr 6, 2022
1390512
fix: Support for WPGraphQL v1.8+ has been added.
kidunot89 Apr 25, 2022
7b0904e
vendor file rebuilt
kidunot89 Apr 26, 2022
c8ab6ab
fix: Ticket connections fixed.
kidunot89 Apr 26, 2022
a1f9aa0
Merge pull request #45 from the-events-calendar/fix/wp-graphql-v1.8-s…
kidunot89 Apr 28, 2022
c0cbee0
build(tests-php.yml) do not re-init ql-events
lucatume Apr 29, 2022
c739827
fix: WPGraphQL installation added to tests-php.yml workflow
kidunot89 May 23, 2022
e1ca113
fix: tests-php.yml workflow updated.
kidunot89 May 23, 2022
ef5fc73
fix: tests-php.yml workflow updated.
kidunot89 May 23, 2022
16fe972
fix: tests-php.yml workflow updated.
kidunot89 May 23, 2022
b9ec62c
fix: tests-php.yml workflow updated.
kidunot89 May 23, 2022
11470bd
fix: tests-php.yml workflow updated.
kidunot89 May 23, 2022
d431b61
fix: tests-php.yml workflow updated.
kidunot89 May 23, 2022
e60bac4
fix: tests-php.yml workflow updated.
kidunot89 May 23, 2022
2e1431e
fix: tests-php.yml workflow updated.
kidunot89 May 23, 2022
a84b5c6
fix: is_ticket_events_loaded() refactored
kidunot89 Jul 28, 2022
92582bc
refactor: PHPCS added and enforced.
kidunot89 Jul 28, 2022
931e738
devops: linter dependencies changed
kidunot89 Jul 28, 2022
0fc7122
devops: lint GA workflow PHP version changed to 8.0
kidunot89 Jul 28, 2022
64344d9
devops: tests-php GA workflow updated.
kidunot89 Jul 28, 2022
69b3470
chore: README badges changed.
kidunot89 Jul 28, 2022
3d43227
chore: repeated get_includes_directory calls refactored
kidunot89 Aug 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .env.testing.tric
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# This file will be consumed by both the CI and the tests.
# Some environment variables might not apply to one but might apply to the other: modify with care.

# What version of WordPress we want to install and test against.
# This has to be compatible with the `wp core download` command, see https://developer.wordpress.org/cli/commands/core/download/.
WP_VERSION=latest

# A space-separated list of plugin repositories that will be cloned in the WordPress installation folder and that are
# required for the plugin tests.
# E.g. "acme/plugin-one acme/plugin-two pirates/plugin-three".
# This value will be used in a bash array declaration to iterate and clone the plugins one by one; validate locally the
# format of this array using this bash command after exporting the var:
# declare -a plugins=(`echo ${REQUIRED_PLUGIN_REPOS}`); for p in "${plugins[@]}"; do echo "$p"; done
REQUIRED_PLUGIN_REPOS="moderntribe/the-events-calendar"

# A space-separated list of plugins slugs repositories that are required to be active for this plugin tests to work.
# E.g. "plugin-one plugin-two plugin-three".
# This value will be used in the wp-cli `wp activate` command; validate locally by trying to run the command:
# wp plugin activate ${REQUIRED_PLUGINS_SLUGS}`)
REQUIRED_PLUGINS_SLUGS="the-events-calendar wp-graphql woocommerce event-tickets"

# This is where, in the context of the CI, we'll install and configure WordPress.
# See `.travis.yml` for more information.
WP_ROOT_FOLDER=/var/www/html

# The WordPress installation will be served from the Docker container.
# See `dev/docker/ci-compose.yml` for more information.
WP_URL=http://wordpress.test
WP_DOMAIN=wordpress.test

# The credentials that will be used to access the site in acceptance tests
# in methods like `$I->loginAsAdmin();`.
WP_ADMIN_USERNAME=admin
WP_ADMIN_PASSWORD=password

WP_DB_PORT=3306

# The databse is served from the Docker `db` container.
# See `dev/docker/ci-compose.yml` for more information.
WP_TABLE_PREFIX=wp_
WP_DB_HOST=db
WP_DB_NAME=test
WP_DB_USER=root
WP_DB_PASSWORD=password

# The test databse is served from the Docker `db` container.
# See `dev/docker/ci-compose.yml` for more information.
WP_TEST_DB_HOST=db
WP_TEST_DB_NAME=test
WP_TEST_DB_USER=root
WP_TEST_DB_PASSWORD=password

# We're using Selenium and Chrome for acceptance testing.
# In CI context we're starting a Docker container to handle that.
# See the `dev/docker/ci-compose.yml` file.
CHROMEDRIVER_HOST=chrome
CHROMEDRIVER_PORT=4444

# The URL of the WordPress installation from the point of view of the Chromedriver container.
# Why not just use `wordpress`? While Chrome will accept an `http://wordpress` address WordPress
# will not, we call the WordPress container with a seemingly looking legit URL and leverage the
# lines that, in the `wp-config.php` file, will make it so that WordPress will use as its home
# URL whatever URL we reach it with.
# See the `dev/docker/wp-config.php` template for more information.
WP_CHROMEDRIVER_URL=http://wordpress.test

# To run the tests let's force the background-processing lib to run in synchronous (single PHP thread) mode.
TRIBE_NO_ASYNC=1


# We're using Docker to run the tests.
USING_CONTAINERS=1

TESTS_DIR=tests
TESTS_OUTPUT=tests/_output
TESTS_DATA=tests/_data
TESTS_SUPPORT=tests/_support
TESTS_ENVS=tests/_envs
44 changes: 44 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Coding-Standards

on:
push:
branches:
- master
pull_request:
branches:
- master
paths:
- '**.php'

jobs:
Coding-Standards:
runs-on: ubuntu-latest
name: "Lint code with PHPCS"
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: mbstring, intl
tools: composer

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Install dependencies
run: |
composer install

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer

- name: Run PHP CodeSniffer
run: composer lint
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Package for Release

on:
release:
types: [ published ]

jobs:
tag:
name: Package new release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mbstring, intl
tools: composer
- name: Install dependencies
run: |
composer install --no-dev --optimize-autoloader
- name: Create Artifact
run: |
mkdir plugin-build
composer archive -vvv --format=zip --file="plugin-build/ql-events"
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ql-events
path: plugin-build/ql-events.zip
- name: Upload release asset
uses: softprops/action-gh-release@v1
with:
files: plugin-build/ql-events.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading