-
Notifications
You must be signed in to change notification settings - Fork 13
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 #7 from ikhsan3adi/ci
chore: Add test workflow
- Loading branch information
Showing
6 changed files
with
78 additions
and
58 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
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,59 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
services: | ||
mysql: | ||
image: mysql:8.0 | ||
env: | ||
# The MySQL docker container requires these environment variables to be set | ||
# so we can create and migrate the test database. | ||
# See: https://hub.docker.com/_/mysql | ||
MYSQL_DATABASE: db_book_library_test | ||
MYSQL_ROOT_PASSWORD: root | ||
ports: | ||
# Opens port 3306 on service container and host | ||
# https://docs.github.com/en/actions/using-containerized-services/about-service-containers | ||
- 3306:3306 | ||
# Before continuing, verify the mysql container is reachable from the ubuntu host | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Setup environment | ||
run: cp .env.example .env | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" | ||
# Docs: https://getcomposer.org/doc/articles/scripts.md | ||
|
||
- name: Run test suite | ||
run: composer run-script test |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -123,4 +123,4 @@ nb-configuration.xml | |
|
||
/results/ | ||
/phpunit*.xml | ||
/.phpunit.*.cache | ||
/.phpunit.*.cache |
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 +1 @@ | ||
{"version":1,"defects":[],"times":{"ExampleDatabaseTest::testModelFindAll":0.063000000000000000444089209850062616169452667236328125,"ExampleDatabaseTest::testSoftDeleteLeavesRow":0.008000000000000000166533453693773481063544750213623046875,"ExampleSessionTest::testSessionSimple":0.00200000000000000004163336342344337026588618755340576171875,"HealthTest::testIsDefinedAppPath":0.001000000000000000020816681711721685132943093776702880859375,"HealthTest::testBaseUrlHasBeenSet":0.005000000000000000104083408558608425664715468883514404296875}} | ||
{"version":1,"defects":{"ExampleDatabaseTest::testModelFindAll":4,"ExampleDatabaseTest::testSoftDeleteLeavesRow":4},"times":{"ExampleDatabaseTest::testModelFindAll":0.2260000000000000064392935428259079344570636749267578125,"ExampleDatabaseTest::testSoftDeleteLeavesRow":0.1449999999999999900079927783735911361873149871826171875,"ExampleSessionTest::testSessionSimple":0.00200000000000000004163336342344337026588618755340576171875,"HealthTest::testIsDefinedAppPath":0.001000000000000000020816681711721685132943093776702880859375,"HealthTest::testBaseUrlHasBeenSet":0.01600000000000000033306690738754696212708950042724609375}} |
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