-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (56 loc) · 1.81 KB
/
ci.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
on: [push, pull_request]
name: CI
jobs:
test:
name: PHP Linting and Tests
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install JavaScript dependencies
run: npm install
- name: Do webpack build
run: npm run prod
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mcrypt sqlite3
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(php composer.phar config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install PHP dependencies
run: php composer.phar install --prefer-dist --no-interaction --no-suggest
- name: Set up application
run: |
cp .env.ci .env
rm .env.testing
php artisan key:generate
touch database/database.sqlite
chmod a+w database/database.sqlite
php artisan migrate
- name: Install Chrome
uses: browser-actions/setup-chrome@v1
- name: Print Chrome version
run: chrome --version
- name: Install ChromeDriver
run: php artisan dusk:chrome-driver --detect
- name: Start application
run: |
php artisan serve &
sleep 2 # give the PHP server time to start
- name: Run tests
run: php artisan test