Skip to content

Commit

Permalink
Split pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
renakdup committed Nov 29, 2023
1 parent 6671de7 commit 8516d34
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Unit Tests
name: PHPStan

env:
PHP_VER: "7.4"
Expand All @@ -22,19 +22,25 @@ jobs:
php-version: ${{ env.PHP_VER }}
tools: composer:v${{ env.COMPOSER_VER }}

- name: Cache Composer dependencies
uses: actions/cache@v3
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Run Composer
- name: Install Composer packages
run: |
export COMPOSER_CACHE_DIR=/tmp/composer-cache # change cache directory to be able to use cache of php-actions/composer@v6 jobs
composer install
- name: Run PHPUnit
run: composer run phpunit
cd ./wp-content/plugins/core/ && composer install
- name: Run PHPStan
run: composer run phpstan



43 changes: 43 additions & 0 deletions .github/workflows/phpunit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: UnitTests

env:
PHP_VER: "7.4"
COMPOSER_VER: "2.1"

on:
push:
branches: [ "main" ]
pull_request:
types: [ synchronize, opened, reopened ]

jobs:
php-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup PHP with Composer
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VER }}
tools: composer:v${{ env.COMPOSER_VER }}

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- 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 Composer packages
run: |
composer install
cd ./wp-content/plugins/core/ && composer install
- name: Run PHPUnit
run: composer run phpunit

0 comments on commit 8516d34

Please sign in to comment.