forked from mapasculturais/mapasculturais
-
Notifications
You must be signed in to change notification settings - Fork 6
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 #28 from RedeMapas/feature/phpunit
Feature/phpunit
- Loading branch information
Showing
46 changed files
with
9,722 additions
and
8,516 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,56 @@ | ||
name: Testing | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
phpunit: | ||
strategy: | ||
matrix: | ||
operating-system: [ubuntu-20.04] | ||
php-versions: ["8.2"] | ||
runs-on: ${{ matrix.operating-system }} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Add hosts to /etc/hosts | ||
run: | | ||
sudo echo "127.0.0.1 db" | sudo tee -a /etc/hosts | ||
- uses: hoverkraft-tech/compose-action@v1.5.1 | ||
with: | ||
compose-file: "dev/docker-compose.yml" | ||
services: "db" | ||
up-flags: "-d" | ||
down-flags: "-v" | ||
|
||
- name: Install composer and dependencies | ||
uses: php-actions/composer@v6 | ||
|
||
- name: Run migrations | ||
run: | | ||
mkdir var/private-files/dbupdate_documento | ||
php src/tools/apply-updates.php | ||
env: | ||
APP_MODE: development | ||
|
||
- name: PHPUnit Tests | ||
uses: php-actions/phpunit@v3 | ||
env: | ||
XDEBUG_MODE: coverage | ||
with: | ||
configuration: phpunit.xml | ||
php_extensions: pdo_pgsql xdebug mbstring curl xml | ||
args: tests --coverage-clover ./coverage.xml | ||
|
||
- name: Upload to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODE_COV_TOKEN }} | ||
files: ./coverage.xml | ||
verbose: true |
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
Oops, something went wrong.