-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (52 loc) · 1.93 KB
/
cypress-tests.yml
File metadata and controls
64 lines (52 loc) · 1.93 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
name: Cypress Tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [7.4]
machines: [1, 2]
name: P${{ matrix.php }} - ${{ matrix.os }} - M${{ matrix.machines }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Copy ENV Laravel Configuration for CI
run: php -r "file_exists('.env') || copy('.env.cypress.example', '.env');"
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none
- name: Install dependencies
run: |
composer install
- name: Generate key
run: php artisan key:generate
- name: Create database and run migrations
run: |
sudo /etc/init.d/mysql start
mysql -u root -proot -e 'CREATE DATABASE IF NOT EXISTS shark;'
php artisan migrate:refresh --seed
- name: Copy Cypress configs
run: php -r "file_exists('cypress.json') || copy('cypress.json.example', 'cypress.json');"
- name: Cypress run
uses: cypress-io/github-action@v1
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
with:
record: true
parallel: true
group: Parallel on ${{ matrix.os }} - ${{ matrix.php }}
build: npm run production
start: php artisan serve --host 0.0.0.0 --port 8000
wait-on: http://localhost:8000