This repository has been archived by the owner on May 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
76 lines (60 loc) · 1.86 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: phpunit
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
phpunit:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.3
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: secretic
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- name: Install PHP extensions
run: sudo apt-get install -y php-phpdbg
- name: Check phpdbg version
run: phpdbg -V
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.ci', '.env');"
- name: Install Composer Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Clear Configuration
run: php artisan config:clear
- name: Run the migrations
run: php artisan migrate
- name: Run tests via PHPUnit
env:
XDEBUG_MODE: coverage
run: |
vendor/bin/phpunit --coverage-clover=coverage.xml
cat ./coverage.xml
- name: Show coverage.xml
run: cat ./coverage.xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: flamenotes/flamenotes
files: ./coverage.xml
fail_ci_if_error: true
flags: unittests
name: codecov-umbrella
verbose: true
env_vars: PHP