Skip to content

Commit 16dee79

Browse files
committed
test workflow
1 parent 525d9e3 commit 16dee79

5 files changed

Lines changed: 60 additions & 23 deletions

File tree

.env.travis renamed to .env.testing

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ DB_CONNECTION=mysql
88
DB_HOST=127.0.0.1
99
DB_PORT=3306
1010
DB_DATABASE=jvscript_testing
11-
DB_USERNAME=travis
12-
DB_PASSWORD=
11+
DB_USERNAME=root
12+
DB_PASSWORD=root
1313

1414
BROADCAST_DRIVER=log
1515
CACHE_DRIVER=file

.github/workflows/phpunit.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: PHPUnit Tests
2+
3+
on:
4+
push:
5+
branches: [ production, develop ]
6+
pull_request:
7+
branches: [ production, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
15+
- uses: mirromutth/mysql-action@v1.1
16+
with:
17+
container port: 3306
18+
mysql version: '5.7'
19+
mysql database: 'jvscript_testing'
20+
mysql root password: 'root'
21+
22+
- name: Checkout code
23+
uses: actions/checkout@v3
24+
25+
- name: Setup PHP 7.4
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: '7.4'
29+
extensions: mbstring, dom, fileinfo, mysql, gd
30+
coverage: none
31+
32+
- name: Create .env
33+
run: |
34+
php -r "copy('.env.testing', '.env');"
35+
cat .env
36+
37+
- name: Install Dependencies
38+
run: composer install --no-interaction --prefer-dist --no-progress
39+
40+
- name: Generate application key
41+
run: php artisan key:generate
42+
43+
- name: Set up database
44+
run: |
45+
mysql -h 127.0.0.1 -u root -proot -e "CREATE DATABASE IF NOT EXISTS jvscript_testing;"
46+
php artisan migrate --force
47+
48+
- name: Run PHPUnit tests
49+
env:
50+
DB_CONNECTION: testing
51+
DB_HOST: 127.0.0.1
52+
DB_PORT: 3306
53+
DB_DATABASE: jvscript_testing
54+
DB_USERNAME: root
55+
DB_PASSWORD: root
56+
APP_ENV: testing
57+
run: vendor/bin/phpunit

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,7 @@ Les vues sont dans `/ressources/views`
3636

3737
Elles sont définies dans le routeur : `/routes/web.php` et pointe soit directement vers une vue, ou vers un controller.
3838

39-
### Controller
4039

41-
Le controller principal (`JvscriptController.php`) est dans `App\Http\Controllers\`
4240

43-
## Todolist (dev du site)
4441

45-
### [C'est par ici ](https://github.com/jvscript/jvscript.github.io/projects/1)
4642

47-
48-
## Phpunit
49-
50-
GRANT ALL PRIVILEGES ON `jvscript\_testing`.* TO 'travis'@'localhost';

config/database.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
'port' => env('DB_PORT', '3306'),
7373
'database' => 'jvscript_testing',
7474
'username' => env('DB_USERNAME', 'forge'),
75+
'password' => env('DB_PASSWORD', ''),
7576
'charset' => 'utf8',
7677
'collation' => 'utf8_unicode_ci',
7778
'prefix' => '',

0 commit comments

Comments
 (0)