Skip to content

Commit

Permalink
chore: trigger units test on pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Sep 14, 2023
1 parent 7472a47 commit 0647429
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/test-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,40 @@ jobs:
run: composer install --prefer-dist --no-progress --no-suggest
- name: PHPStan Static Analysis
run: composer phpstan

unit:
name: UnitTests
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
# setup the composer cache (vendor) with github actions cache and the cache dir defined in the previous step
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
# run composer install
- name: Install composer
run: composer install --prefer-dist --no-progress --no-suggest

- name: Create License File
run: |
printf "{\"key\":\"${{ secrets.OTTER_PRO_LICENSE }}\"}" > license.json
- name: Setup WP Env
run: |
npm run test:unit:php:setup
- name: Run PHP Unit Tests
run: |
npm run test:unit:php:base
2 changes: 1 addition & 1 deletion inc/plugins/class-stripe-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Stripe_API {
* @access public
*/
public function __construct() {
if ( ! self::has_keys() && empty( $client ) ) {
if ( ! self::has_keys() ) {
return;
}

Expand Down

0 comments on commit 0647429

Please sign in to comment.