Skip to content

Commit

Permalink
Add benchmarks to travis
Browse files Browse the repository at this point in the history
  • Loading branch information
hxtree committed Sep 16, 2021
1 parent b12d3f9 commit 77bcd40
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ before_script:

jobs:
include:
- stage: Test
- stage: PHP Info
script:
- php --version
- stage: Unit Test
script:
- mkdir -p tests/output
- XDEBUG_MODE=coverage phpunit --configuration phpunit.xml
after_success:
- bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -f tests/output/clover.xml
- bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -f tests/output/clover.xml
- stage: Benchmark Test
script:
- bin/phpbench run --report=env --progress=dots
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ create an issue, and/or if possible create a pull request.

For local package development use [Docker](https://www.docker.com/products/docker-desktop):

**Clone Repo**
#### Local Setup
Clone Repo
```
git clone https://github.com/Ouxsoft/LuckByDice.git
cd LuckByDice
```


**Standard container**
```
docker build --target standard --tag luckbydice:latest -f Dockerfile .
Expand All @@ -96,20 +98,27 @@ docker run -it luckbydice:latest php tests/src/Feature/Cli.php 6d6
docker build --target test --tag luckbydice:latest -f Dockerfile .
docker run -it --mount type=bind,source="$(pwd)"/,target=/application/ luckbydice:latest composer install
# Feature CLI Test using local volume
docker run -it --mount type=bind,source="$(pwd)"/,target=/application/ luckbydice:latest php tests/src/Feature/Cli.php 1d10+4*2 0
# Interactive Tests server avaliable at http://localhost/
docker run -it -p 80:80 --mount type=bind,source="$(pwd)"/,target=/application luckbydice:latest bash -c 'cd tests/src/Interactive && php -S 0.0.0.0:80'
# Unit Tests using local volume
# Automated Tests
## Unit Tests using local volume
docker run -it --mount type=bind,source="$(pwd)"/,target=/application/ luckbydice:latest composer test
# Benchmark Tests using local volume
## Benchmark Tests using local volume
docker run -it --mount type=bind,source="$(pwd)"/,target=/application/ luckbydice:latest ./vendor/bin/phpbench run tests/src/Benchmark --report=default
```

**Docs container**
## Manual Tests
### Feature CLI Test using local volume
```
docker run -it --mount type=bind,source="$(pwd)"/,target=/application/ luckbydice:latest php tests/src/Feature/Cli.php 1d10+4*2 0
```

### Interactive Tests
Creates a server available at [http://localhost/](http://localhost/)
```
docker run -it -p 80:80 --mount type=bind,source="$(pwd)"/,target=/application luckbydice:latest bash -c 'cd tests/src/Interactive && php -S 0.0.0.0:80'
```

### Build Docs
```
# Build Docs
docker build --target docs --tag luckbydice:docs-latest -f Dockerfile .
Expand Down

0 comments on commit 77bcd40

Please sign in to comment.