-
Notifications
You must be signed in to change notification settings - Fork 55
64 lines (52 loc) 路 1.8 KB
/
Copy pathtests.yml
File metadata and controls
64 lines (52 loc) 路 1.8 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: Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
name: Laravel tests (PHP 8.3)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: '8.3'
extensions: pdo, pdo_sqlite, mbstring, zip, gd, bcmath
coverage: none
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '20'
- name: Cache Composer packages
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: backend/vendor
key: composer-${{ hashFiles('backend/composer.lock') }}
restore-keys: composer-
- name: Cache npm packages
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: backend/node_modules
key: npm-${{ hashFiles('backend/package-lock.json') }}
restore-keys: npm-
- name: Install Composer dependencies
working-directory: backend
run: composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Install npm dependencies and build assets
working-directory: backend
run: npm ci && npm run build
- name: Run frontend tests
working-directory: backend
run: npm test
- name: Copy .env and generate key
working-directory: backend
run: |
cp .env.example .env
php artisan key:generate
- name: Run tests
working-directory: backend
run: php artisan test --stop-on-failure