-
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (57 loc) · 1.89 KB
/
tests.yml
File metadata and controls
73 lines (57 loc) · 1.89 KB
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
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
extensions: mbstring, bcmath, pdo, mysql, dom, curl
coverage: xdebug
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Start database
run: sudo /etc/init.d/mysql start
- name: Create database
run: mysql -e "CREATE DATABASE IF NOT EXISTS liberu;" -uroot -proot
- name: Copy environment file
run: cp .env.testing .env
- name: Install dependencies
run: composer install --no-progress --prefer-dist --with-all-dependencies
- name: Generate application key
run: php artisan key:generate
- name: Optimize Laravel
run: |
php artisan config:clear
php artisan cache:clear
php artisan route:clear
php artisan config:cache
- name: Run database migrations
run: php artisan migrate --force
- name: Seed database
run: php artisan db:seed
- name: Run tests
run: vendor/bin/pest --coverage --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true