-
-
Notifications
You must be signed in to change notification settings - Fork 3
116 lines (95 loc) · 3.2 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Tests
on: [push]
jobs:
dusk:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
node-version:
- 16
steps:
- name: Checkout code
uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}
- name: "Install Node"
uses: actions/setup-node@v1
with:
node-version: "${{ matrix.node-version }}"
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: "Install locked dependencies with npm"
run: "npm ci --ignore-scripts"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
- name: "Install locked dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"
- name: Prepare The Environment
run: cp .env.example .env
- name: Compile assets
run: npm run build
- name: Generate Application Key
run: php artisan key:generate
- name: Clone docs
run: git clone https://github.com/protonemedia/laravel-splade-docs docs
- name: Run Tests
run: php artisan test
env:
TORCHLIGHT_TOKEN: ${{ secrets.TORCHLIGHT_TOKEN }}
- name: Upgrade Chrome Driver
run: php artisan dusk:chrome-driver --detect
- name: Start Chrome Driver
run: ./vendor/laravel/dusk/bin/chromedriver-linux --port=9515 &
- name: Run Laravel Server
run: php artisan serve --no-reload &
env:
TORCHLIGHT_TOKEN: ${{ secrets.TORCHLIGHT_TOKEN }}
- name: Run Dusk Tests
run: php artisan dusk
env:
APP_URL: "http://127.0.0.1:8000"
TORCHLIGHT_TOKEN: ${{ secrets.TORCHLIGHT_TOKEN }}
- name: Upload Screenshots
if: failure()
uses: actions/upload-artifact@v3
with:
name: screenshots
path: tests/Browser/screenshots
- name: Upload Console Logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: console
path: tests/Browser/console
- name: Upload Logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: logs
path: storage/logs