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

Feature/upgrade php and phpunit #34

Merged
merged 17 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
54 changes: 27 additions & 27 deletions .github/workflows/php-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,40 @@ on:
- develop
- trunk
paths:
- '**.php'
- "**.php"
pull_request:
branches:
- develop
paths:
- '**.php'
- "**.php"

jobs:
php-compatibility:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup proper PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.4

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

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

- name: Install dependencies
run: composer install --prefer-dist

- name: Run PHP Compatibility
run: ./vendor/bin/phpcs --standard=./phpcs-compat.xml -p .
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup proper PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 8.2

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

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

- name: Install dependencies
run: composer install --prefer-dist

- name: Run PHP Compatibility
run: ./vendor/bin/phpcs --standard=./phpcs-compat.xml -p .
72 changes: 36 additions & 36 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,49 @@ on:
- develop
- trunk
paths:
- '**.php'
- "**.php"
pull_request:
branches:
- develop
paths:
- '**.php'
- "**.php"

jobs:
phpcs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup proper PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.4

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

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

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
with:
files: |
**/*.php

- name: Install dependencies
run: composer install --prefer-dist

- name: Run PHP_CodeSniffer
run: |
HEAD_REF=$(git rev-parse HEAD)
git checkout $HEAD_REF
./vendor/bin/phpcs-changed -s --git --git-base origin/${{ github.base_ref }} ${{ steps.changed-files.outputs.all_changed_files }}
- name: Checkout
uses: actions/checkout@v4

- name: Setup proper PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 8.2

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

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

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
with:
files: |
**/*.php

- name: Install dependencies
run: composer install --prefer-dist

- name: Run PHP_CodeSniffer
run: |
HEAD_REF=$(git rev-parse HEAD)
git checkout $HEAD_REF
./vendor/bin/phpcs-changed -s --git --git-base origin/${{ github.base_ref }} ${{ steps.changed-files.outputs.all_changed_files }}
48 changes: 24 additions & 24 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,44 @@ on:
- develop
- trunk
paths:
- '**.php'
- "**.php"
pull_request:
branches:
- develop
paths:
- '**.php'
- "**.php"

jobs:
phpunit:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- uses: getong/mariadb-action@v1.1
- uses: getong/mariadb-action@v1.1

- name: Setup proper PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- name: Setup proper PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 8.2

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

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

- name: Install dependencies
run: composer install
- name: Install dependencies
run: composer install

- name: Setup WP Tests
run: bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1
- name: Setup WP Tests
run: bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1

- name: PHPUnit
run: './vendor/bin/phpunit'
- name: PHPUnit
run: "./vendor/bin/phpunit"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ phpunit.xml
uploads
upgrade
cache
.phpunit.result.cache

# Project Files
dist
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"php": ">=7.4"
},
"require-dev": {
"10up/phpcs-composer": "dev-master",
"10up/phpcs-composer": "~3@RC",
"squizlabs/php_codesniffer": "~3.7.1",
"yoast/phpunit-polyfills": "^1.0",
"phpunit/phpunit": "~7.5.0",
"phpunit/phpunit": "~9.0",
"sirbrillig/phpcs-changed": "^2.11"
},
"autoload": {
Expand Down
Loading