Skip to content

wip

wip #2388

Workflow file for this run

name: Test on push
on: push
jobs:
test:
name: Test
runs-on: ubuntu-20.04
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: webumenia_test
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306
elasticsearch:
image: ghcr.io/slovaknationalgallery/elasticsearch-webumenia:7.3.1
env:
discovery.type: single-node
ports:
- 9200
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer dependencies
uses: actions/cache@v3
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 "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
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 production
env:
MIX_SKIP_CSS_URL_PROCESSING: 1
- 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] }}