Vite build fix #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: [push, pull_request] | |
jobs: | |
laravel-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: ['8.1', '8.2'] | |
steps: | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
- uses: actions/checkout@v3 | |
- 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: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Get node.js cache directory | |
id: node-cache | |
run: echo "::set-output name=dir::$(npm config get cache)" | |
- name: Cache npm dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.node-cache.outputs.dir }} | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-npm- | |
- name: Install Dependencies | |
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
- name: Static analysis | |
run: php vendor/bin/phpstan analyse --no-progress | |
- name: Generate key | |
run: php artisan key:generate --env=testing | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install Node dependencies | |
run: npm install | |
- name: Build frontend code | |
run: npm run build | |
- name: Directory permissions | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Create database | |
run: | | |
mkdir -p database | |
touch database/database.sqlite | |
php artisan migrate --seed --env=testing | |
- name: Execute tests | |
run: php artisan test --without-tty --env=testing |