-
Notifications
You must be signed in to change notification settings - Fork 13
77 lines (63 loc) · 2.3 KB
/
main.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
name: CI
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.4, 8.0]
laravel: [6, 8]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
extensions: ctype, iconv, intl, json, mbstring, pdo, pdo_sqlite
coverage: none
- name: Checkout Laravel 6 Sample
if: matrix.laravel == 6
uses: actions/checkout@v2
with:
repository: codeception/laravel-module-tests
path: framework-tests
ref: 6.x
- name: Checkout Laravel 8 Sample
if: matrix.laravel == 8
uses: actions/checkout@v2
with:
repository: codeception/laravel-module-tests
path: framework-tests
ref: main
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/[email protected]
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
- name: Install dependencies
run: |
composer require laravel/framework=${{ matrix.laravel }} --ignore-platform-req=php --no-update
composer install --prefer-dist --no-progress --ignore-platform-req=php
- name: Validate composer.json and composer.lock
run: composer validate
working-directory: framework-tests
- name: Install Laravel Sample
run: |
composer remove codeception/module-laravel --dev --no-update
composer install --no-progress
working-directory: framework-tests
- name: Prepare the test environment and run test suite
run: |
cp .env.testing .env
php artisan config:cache
touch database/database.sqlite
php artisan migrate --seed --env=testing --force
working-directory: framework-tests
- name: Run test suite
run: php vendor/bin/codecept run Functional -c framework-tests