-
Notifications
You must be signed in to change notification settings - Fork 457
80 lines (66 loc) · 1.91 KB
/
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
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
77
78
79
80
name: Tests
on:
push:
branches:
- 2.*
- main
pull_request:
permissions:
contents: read
jobs:
default:
name: Unit, Integration and Pages
if: '! github.event.pull_request.draft'
runs-on: ubuntu-latest
env:
APP_URL: http://localhost:8000
APP_ENV: testing
DB_CONNECTION: pgsql
DB_HOST: localhost
DB_PORT: 5432
DB_DATABASE: ieducar
DB_USERNAME: postgres
DB_PASSWORD: postgres
API_ACCESS_KEY: ieducar-access-key
API_SECRET_KEY: ieducar-secret-key
BROADCAST_DRIVER: log
CACHE_DRIVER: array
QUEUE_CONNECTION: sync
SESSION_DRIVER: array
LEGACY_SEED_DATA: false
COMPOSER_ALLOW_SUPERUSER: 1
NODE_OPTIONS: --max_old_space_size=1024
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ieducar
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
steps:
- name: Setup PHP
uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: bcmath, gd, pdo, pcntl, pdo_pgsql, pgsql, zip
env:
update: true
- 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@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: composer new-install
- name: Prepare tests
run: php artisan legacy:create:tests
- name: Unit tests
run: vendor/bin/phpunit