-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from the-kbA-team/2-github-actions
Switched from Travis to GitHub actions.
- Loading branch information
Showing
3 changed files
with
77 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: "CI workflow" | ||
on: | ||
# Triggers the workflow on push or pull request events | ||
push: | ||
pull_request: | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
permissions: | ||
contents: "read" | ||
jobs: | ||
|
||
composer: | ||
name: "Composer config validation" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v3" | ||
- name: "Validate composer.json" | ||
run: "composer validate --strict" | ||
|
||
php: | ||
name: "PHP tests" | ||
runs-on: "ubuntu-latest" | ||
strategy: | ||
matrix: | ||
php_version: | ||
- "7.2" | ||
- "7.4" | ||
env: | ||
CC_TEST_REPORTER_ID: "c8bc13b8787c6de68ae094688dec7fd7bb3a14445d560194b5785fae2623d489" | ||
|
||
steps: | ||
- name: "GIT checkout" | ||
uses: "actions/checkout@v3" | ||
|
||
- name: "Setup PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "${{ matrix.php_version }}" | ||
coverage: "xdebug" | ||
|
||
- name: "PHP syntax validation" | ||
run: | | ||
php -l src/ | ||
php -l tests/ | ||
- name: "Get composer cache directory" | ||
id: "composer-cache" | ||
run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT' | ||
|
||
- name: "Cache composer dependencies" | ||
uses: "actions/cache@v3" | ||
with: | ||
path: "${{ steps.composer-cache.outputs.dir }}" | ||
# Use composer.json for key, if composer.lock is not committed. | ||
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}" | ||
restore-keys: "${{ runner.os }}-composer-" | ||
|
||
- name: "Composer install dependencies" | ||
run: "composer install --prefer-dist --no-progress" | ||
|
||
- name: "CodeClimate Reporter Setup" | ||
run: | | ||
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||
chmod +x ./cc-test-reporter | ||
./cc-test-reporter before-build | ||
- name: "PHPUnit tests" | ||
run: | | ||
php vendor/bin/phpunit --coverage-clover clover.xml --coverage-text | ||
export PHPUNIT_EXIT_CODE=$? | ||
- name: "CodeClimate report" | ||
run: "./cc-test-reporter after-build -t clover" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/.idea/ | ||
/vendor/ | ||
/.phpunit.result.cache | ||
/.uuid | ||
/clover.xml |
This file was deleted.
Oops, something went wrong.