-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (79 loc) · 2.77 KB
/
app-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
81
82
83
84
85
86
87
88
89
90
91
92
93
name: App Tests
on:
push:
branches:
- master
- '*.x'
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
tests:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
php: [ 8.1, 8.2 ]
laravel: [ 9, 10 ]
stability: [ 'prefer-lowest', 'prefer-stable' ]
variants: [
'',
'--kind username-based'
]
name: PHP ${{ matrix.php }} L${{ matrix.laravel }} ${{ matrix.variants }} (w/ ${{ matrix.stability }})
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: ./monorepo
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none
- name: Create Laravel Project
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer create-project laravel/laravel app "${{ matrix.laravel }}.x" --remove-vcs --prefer-dist --no-interaction
- name: Downgrade Laravel dependencies to lowest supported versions
run: composer update --prefer-lowest --prefer-dist --no-interaction
working-directory: ./app
if: matrix.stability == 'prefer-lowest'
- name: Set Laravel Environment
run: |
sed -i "s/APP_DEBUG=.*/APP_DEBUG=true/" .env
sed -i "s/DB_PASSWORD=.*/DB_PASSWORD=secret/" .env
working-directory: ./app
- name: Relax dependency constraint for claudiodekker/laravel-auth-core
run: |
sed -i "s/\"claudiodekker\/laravel-auth-core\": \".*\"/\"claudiodekker\/laravel-auth-core\": \"\*\"/" composer.json
working-directory: ./monorepo/packages/bladebones
- name: Install Library & Bladebones Adapter
run: |
composer config minimum-stability dev
composer config repositories.library path ../monorepo/packages/core
composer config repositories.adapter path ../monorepo/packages/bladebones
composer require claudiodekker/laravel-auth-core claudiodekker/laravel-auth-bladebones -W --${{ matrix.stability }}
working-directory: ./app
- name: Generate Auth Scaffolding
run: php artisan auth:generate --yes ${{ matrix.variants }}
working-directory: ./app
- name: Migrate Database
run: php artisan migrate
working-directory: ./app
- name: Execute tests
run: vendor/bin/phpunit
working-directory: ./app
services:
mysql:
image: 'mysql:5.7'
ports:
- 3306:3306
env:
MYSQL_DATABASE: laravel
MYSQL_ROOT_PASSWORD: secret