diff --git a/.github/workflows/format_php.yml b/.github/workflows/format_php.yml deleted file mode 100644 index 97fbea0..0000000 --- a/.github/workflows/format_php.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Format (PHP) - -on: - push: - branches: - - '**' - -jobs: - php-cs-fixer: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: nanasess/setup-php@master - with: - php-version: '8.1' - - name: Install Dependencies - run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress - - name: Composer dump-autoload - run: composer dump-autoload - - name: Make phpunit cache dir - run: mkdir -p /home/runner/work/sdk-php/sdk-php/.php.cache - - name: Run php-cs-fixer - run: ./vendor/bin/php-cs-fixer fix - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: php-cs-fixer changes \ No newline at end of file diff --git a/.github/workflows/run-test-and-format.yml b/.github/workflows/run-test-and-format.yml new file mode 100644 index 0000000..97eaf45 --- /dev/null +++ b/.github/workflows/run-test-and-format.yml @@ -0,0 +1,53 @@ +name: Run tests & format + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +jobs: + test: + name: Run tests + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: nanasess/setup-php@master + with: + php-version: 8.1 + + - name: Install Dependencies + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress + + - name: Composer dump-autoload + run: composer dump-autoload + + - name: Execute tests (Unit and Feature tests) via PHPUnit + run: vendor/phpunit/phpunit/phpunit Tests + + format: + name: Fix PHP Coding Style + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: nanasess/setup-php@master + with: + php-version: 8.1 + + - name: Install Dependencies + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress + + - name: Composer dump-autoload + run: composer dump-autoload + + - name: Run php-cs-fixer + run: ./vendor/bin/php-cs-fixer fix + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Apply php-cs-fixer changes diff --git a/.github/workflows/run-tests-api.yml b/.github/workflows/run-tests-api.yml deleted file mode 100644 index 159afea..0000000 --- a/.github/workflows/run-tests-api.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Run tests SDK - -on: - push: - branches: - - '**' - -jobs: - sdk-tests: - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: nanasess/setup-php@master - with: - php-version: '8.1' - - name: Install Dependencies - run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress - - name: Composer dump-autoload - run: composer dump-autoload - - name: Execute tests (Unit and Feature tests) via PHPUnit - run: vendor/phpunit/phpunit/phpunit Tests