-
Notifications
You must be signed in to change notification settings - Fork 19
64 lines (55 loc) · 1.68 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
62
63
64
on:
workflow_call:
jobs:
test:
name: Test
runs-on: ubuntu-20.04
services:
mysql:
image: mysql:8.0.36
env:
MYSQL_DATABASE: webumenia_test
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306
elasticsearch:
image: ghcr.io/slovaknationalgallery/elasticsearch-webumenia:7.17.3
env:
discovery.type: single-node
ports:
- 9200
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ hashFiles('**/composer.lock') }}
restore-keys: composer-
- run: composer install --prefer-dist
- name: Get npm cache directory
id: npm-cache
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: node-${{ hashFiles('**/package-lock.json') }}
restore-keys: node-
- run: npm ci
- name: Build assets
run: npm run build
- name: Test
run: php artisan test
env:
APP_KEY: SomeRandomStringSomeRandomString
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USERNAME: root
DB_DATABASE: webumenia_test
ES_PORT: ${{ job.services.elasticsearch.ports[9200] }}