-
Notifications
You must be signed in to change notification settings - Fork 22
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 #24 from XetaIO/github-actions
Test adding github action to the repository
- Loading branch information
Showing
4 changed files
with
35 additions
and
33 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 |
---|---|---|
@@ -1,36 +1,41 @@ | ||
name: PHP Composer | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
PHPUnit: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: | ||
- 8.1 | ||
- 8.0 | ||
- 7.4 | ||
- 7.3 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v2 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@develop | ||
with: | ||
php-version: ${{ matrix.php }} | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
- run: php -v | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
- name: Create Database | ||
run: | | ||
touch tests/vendor/temp/database.sqlite | ||
chmod 775 tests/vendor/temp/database.sqlite | ||
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" | ||
# Docs: https://getcomposer.org/doc/articles/scripts.md | ||
- name: Run tests | ||
run: vendor/bin/phpunit --coverage-clover tests/vendor/temp/coverage.xml | ||
|
||
- name: Run tests | ||
run: vendor/bin/phpunit | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
files: tests/vendor/temp/coverage.xml |
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
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
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