-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (48 loc) · 1.31 KB
/
test.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
name: Testing
on:
push:
branches:
- main
pull_request:
branches:
- main
types: [ opened, reopened, ready_for_review ]
jobs:
test:
runs-on: ubuntu-22.04
env:
DB_DATABASE: testing
DB_USER: root
DB_PASSWORD: root
steps:
- uses: actions/checkout@v4
- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: zip, sqlite3
coverage: none
- name: Install composer dependencies
run: composer install --no-cache --no-ansi --no-interaction --no-progress
- name: Install node dependencies
run: npm ci
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Copy standard .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Generate key
run: php artisan key:generate
- name: Build frontend
run: |
npm run build
- name: Execute tests
env:
DB_USERNAME: root
DB_PASSWORD: root
run: ./vendor/bin/phpunit