-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.11 KB
/
backend-tests.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
name: Backend tests
on: [ push, pull_request ]
jobs:
tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src
services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: anilibrary-testing
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v4
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: src/vendor
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: xdebug
coverage: xdebug
- name: Install Composer dependencies
run: composer install -qn --no-ansi --no-progress --prefer-dist
- name: Run tests
env:
DB_HOST: 127.0.0.1
run: php artisan test --parallel --coverage