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

Github Actions and PHPCS updates #108

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1ed79e4
Move from Travis to Github Actions
mslinnea Nov 16, 2024
59a792d
phpcs part 1
mslinnea Nov 16, 2024
1451311
PHPCS
mslinnea Nov 19, 2024
69a2179
move github actions files
mslinnea Nov 19, 2024
a69717f
Specify test matrix
mslinnea Nov 22, 2024
702b729
Remove remaining references to travis
mslinnea Nov 22, 2024
952db3c
ES 8.x compat - remove type from endpoint
mslinnea Nov 22, 2024
a6282d6
phpcs ignores
mslinnea Nov 23, 2024
984ed0f
Skips tests due to WP core bug with offset & pagination
mslinnea Dec 6, 2024
d00d908
formatting changes
mslinnea Dec 6, 2024
b857984
Update composer.json
mslinnea Dec 13, 2024
f2a880a
Update .github/workflows/coding-standards.yml
mslinnea Dec 13, 2024
572ca2e
whitespace
mslinnea Dec 13, 2024
a2a3cbb
Update comment block
mslinnea Dec 13, 2024
2d5c664
Update comment block
mslinnea Dec 13, 2024
3b244aa
formatting
mslinnea Dec 13, 2024
f9aa00b
formatting
mslinnea Dec 13, 2024
5a517a4
mysql test matrix
mslinnea Dec 13, 2024
e3d228e
add mysql version to test name
mslinnea Dec 13, 2024
78aff10
Update MySQL test matrix
mslinnea Dec 13, 2024
5b0ebc7
formatting
mslinnea Dec 13, 2024
14fb9b1
update test setup function
mslinnea Dec 13, 2024
1cc297e
Update .github/workflows/coding-standards.yml
mslinnea Dec 26, 2024
6cec296
Update .github/workflows/coding-standards.yml
mslinnea Dec 26, 2024
ca43537
Update .github/workflows/unit-tests.yml
mslinnea Dec 26, 2024
3bb279e
Update .github/workflows/unit-tests.yml
mslinnea Dec 26, 2024
a4065b3
Update composer.json
mslinnea Dec 26, 2024
4d3c5d8
Mark as knownWPBug
mslinnea Dec 26, 2024
f2a0d09
Revert "Update .github/workflows/unit-tests.yml"
mslinnea Dec 26, 2024
c7382d0
Revert "Update .github/workflows/unit-tests.yml"
mslinnea Dec 26, 2024
2d6400c
Update actions and use ubuntu version with svn
mslinnea Dec 26, 2024
28d4e7d
Use ubuntu latest and install svn
mslinnea Dec 26, 2024
05e2834
Revert "Mark as knownWPBug"
mslinnea Dec 26, 2024
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
48 changes: 48 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Coding Standards

on: pull_request

jobs:
phpcs:
name: PHPCS
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: ['8.2']
mslinnea marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request' }}
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout code
uses: actions/checkout@v2
mslinnea marked this conversation as resolved.
Show resolved Hide resolved

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Log information
run: |
echo "$GITHUB_REF"
echo "$GITHUB_EVENT_NAME"
git --version
php --version
composer --version

- name: Validate Composer
run: composer validate --strict

- name: Install dependencies
uses: ramsey/composer-install@v1
mslinnea marked this conversation as resolved.
Show resolved Hide resolved
with:
composer-options: "--ignore-platform-reqs"

- name: Run PHPCS
run: composer phpcs
85 changes: 85 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Unit Tests

on: pull_request

jobs:
tests:
name: "WP: ${{ matrix.wp_version }} - PHP: ${{ matrix.php }} - ES: ${{ matrix.es_version }} (MU: ${{ matrix.multisite }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false # do not fail fast, let all the failing tests fail.
matrix:
php: [8.2, 8.3, 8.4]
es_version: [7.17.25, 8.16.1]
multisite: [0]
wp_version: ["latest", "nightly"]
env:
CACHEDIR: /tmp/test-cache
WP_CORE_DIR: /tmp/wordpress/
WP_TESTS_DIR: /tmp/wordpress-tests-lib
WP_VERSION: ${{ matrix.wp_version }}
WP_MULTISITE: ${{ matrix.multisite }}
services:
mysql:
image: mysql:5.7
renatonascalves marked this conversation as resolved.
Show resolved Hide resolved
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request' }}
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Check out code
uses: actions/checkout@v2
mslinnea marked this conversation as resolved.
Show resolved Hide resolved

- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144

- name: Set up Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: ${{ matrix.es_version }}
security-enabled: false

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
tools: composer:v2
coverage: none

- name: Install dependencies
uses: ramsey/composer-install@v1
mslinnea marked this conversation as resolved.
Show resolved Hide resolved
with:
composer-options: "--ignore-platform-reqs"

- name: Log information
run: |
echo "$GITHUB_REF"
echo "$GITHUB_EVENT_NAME"
git --version
php --version
composer --version

- name: Set up WordPress
run: |
bash <(curl -s "https://raw.githubusercontent.com/wp-cli/sample-plugin/master/bin/install-wp-tests.sh") wordpress_test root '' 127.0.0.1 ${{ matrix.wp_version }}
rm -rf "${WP_CORE_DIR}wp-content/plugins"
mkdir -p "${WP_CORE_DIR}wp-content/plugins/es-wp-query"
rsync -a --exclude=.git . "${WP_CORE_DIR}wp-content/plugins/es-wp-query"

- name: Run tests
run: |
cd ${WP_CORE_DIR}wp-content/plugins/es-wp-query
composer phpunit
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ wpcom-helper.php
/report/
.idea
.vscode
/vendor/
.phpunit.result.cache
98 changes: 0 additions & 98 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div><a href="https://travis-ci.org/alleyinteractive/es-wp-query"><img align="right" src="https://travis-ci.org/alleyinteractive/es-wp-query.svg?branch=master" /></a></div>
![Coding Standards workflow](https://github.com/alleyinteractive/es-wp-query/actions/workflows/coding-standards.yml/badge.svg)
![Unit Tests workflow](https://github.com/alleyinteractive/es-wp-query/actions/workflows/unit-tests.yml/badge.svg)

# Elasticsearch Wrapper for WP_Query

Expand Down
Loading
Loading