Bump serve-static and express #248
Workflow file for this run
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: lva | |
on: [push] | |
env: | |
node-modules-cache-name: cache-node-modules | |
composer-packages-cache-name: cache-composer-packages | |
build-artifacts: build-artifacts | |
jobs: | |
debug: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ 'ubuntu-latest' ] | |
php-versions: [ '8.0' ] | |
steps: | |
- name: Setup PHP ${{ matrix.php-versoons }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- run: php --version | |
- run: node --version | |
- run: npm --version | |
build: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ 'ubuntu-latest' ] | |
php-versions: [ '8.0' ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP ${{ matrix.php-versoons }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Setup Environment | |
run: cp .env.ci .env | |
- name: Cache node modules | |
id: cache-node-modules | |
uses: actions/cache@v1 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-build-${{ env.node-modules-cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Install node dependencise | |
run: npm install | |
- name: Cache composer packages | |
id: cache-composer-packages | |
uses: actions/cache@v1 | |
with: | |
path: ./vendor | |
key: ${{ runner.os }}-build-${{ env.composer-packages-cache-name }}-${{ hashFiles('**/composer.lock') }} | |
- name: Install composer dependencies | |
run: composer install -n --ignore-platform-reqs --no-progress --no-suggest | |
- name: Build artifacts | |
run: npm run prod | |
- name: Tar artifacts | |
run: /bin/tar -cz -f ~/${{ env.build-artifacts }}.tgz -C ./public css fonts js mix-manifest.json | |
- name: Store build artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.build-artifacts }} | |
path: ~/${{ env.build-artifacts }}.tgz | |
unit-tests: | |
env: | |
job-name: unit-tests | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ 'ubuntu-latest' ] | |
php-versions: [ '8.0' ] | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP ${{ matrix.php-versoons }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Setup Environment | |
run: | | |
cp .env.ci .env | |
touch ./storage/logs/laravel.log | |
touch ./database/database.sqlite | |
- name: Restore node modules cache | |
uses: actions/cache@v1 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-build-${{ env.node-modules-cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Restore composer packages cache | |
uses: actions/cache@v1 | |
with: | |
path: ./vendor | |
key: ${{ runner.os }}-build-${{ env.composer-packages-cache-name }}-${{ hashFiles('**/composer.lock') }} | |
- name: Migrate Database | |
run: php artisan migrate --force | |
- name: Setup Laravel Passport | |
run: php artisan passport:install | |
- name: Directory Permissions | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Dump Autoloader | |
run: composer dump-autoload | |
- name: Execute Unit tests via PHPUnit | |
run: vendor/bin/phpunit tests/Unit | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
if: failure() | |
with: | |
name: ${{ env.job-name }}-log | |
path: ./storage/logs/*.log | |
integration-tests: | |
env: | |
job-name: integration-tests | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ 'ubuntu-latest' ] | |
php-versions: [ '8.0' ] | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP ${{ matrix.php-versoons }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Setup Environment | |
run: | | |
cp .env.ci .env | |
touch ./storage/logs/laravel.log | |
touch ./database/database.sqlite | |
- name: Restore node modules cache | |
uses: actions/cache@v1 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-build-${{ env.node-modules-cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Restore composer packages cache | |
uses: actions/cache@v1 | |
with: | |
path: ./vendor | |
key: ${{ runner.os }}-build-${{ env.composer-packages-cache-name }}-${{ hashFiles('**/composer.lock') }} | |
- name: Migrate Database | |
run: php artisan migrate --force | |
- name: Setup Laravel Passport | |
run: php artisan passport:install | |
- name: Directory Permissions | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Dump Autoloader | |
run: composer dump-autoload | |
- name: Run Laravel Server | |
run: php artisan serve & | |
- name: Execute Integration tests via PHPUnit | |
run: vendor/bin/phpunit tests/Integration | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
if: failure() | |
with: | |
name: ${{ env.job-name }}-log | |
path: ./storage/logs/*.log | |
feature-tests: | |
env: | |
job-name: feature-tests | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ 'ubuntu-latest' ] | |
php-versions: [ '8.0' ] | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP ${{ matrix.php-versoons }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Setup Environment | |
run: | | |
cp .env.ci .env | |
touch ./storage/logs/laravel.log | |
touch ./database/database.sqlite | |
- name: Restore node modules cache | |
uses: actions/cache@v1 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-build-${{ env.node-modules-cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Restore composer packages cache | |
uses: actions/cache@v1 | |
with: | |
path: ./vendor | |
key: ${{ runner.os }}-build-${{ env.composer-packages-cache-name }}-${{ hashFiles('**/composer.lock') }} | |
- name: Restore building artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: ${{ env.build-artifacts }} | |
- run: tar -xz -f ./${{ env.build-artifacts }}.tgz -C ./public | |
- name: Migrate Database | |
run: php artisan migrate --force | |
- name: Setup Laravel Passport | |
run: php artisan passport:install | |
- name: Directory Permissions | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Dump Autoloader | |
run: composer dump-autoload | |
- name: Run Laravel Server | |
run: php artisan serve & | |
- name: Execute Feature tests via PHPUnit | |
run: vendor/bin/phpunit tests/Feature | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
if: failure() | |
with: | |
name: ${{ env.job-name }}-log | |
path: ./storage/logs/*.log | |
dusk-tests: | |
env: | |
job-name: dusk-tests | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ 'ubuntu-latest' ] | |
php-versions: [ '8.0' ] | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP ${{ matrix.php-versoons }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Setup Environment | |
run: | | |
cp .env.ci .env | |
touch ./storage/logs/laravel.log | |
touch ./database/database.sqlite | |
- name: Restore node modules cache | |
uses: actions/cache@v1 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-build-${{ env.node-modules-cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Restore composer packages cache | |
uses: actions/cache@v1 | |
with: | |
path: ./vendor | |
key: ${{ runner.os }}-build-${{ env.composer-packages-cache-name }}-${{ hashFiles('**/composer.lock') }} | |
- name: Restore building artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: ${{ env.build-artifacts }} | |
- run: tar -xz -f ./${{ env.build-artifacts }}.tgz -C ./public | |
- name: Migrate Database | |
run: php artisan migrate --force | |
- name: Setup Laravel Passport | |
run: php artisan passport:install | |
- name: Directory Permissions | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Dump Autoloader | |
run: composer dump-autoload | |
- name: Update Chrome Driver | |
run: | | |
CHROME_VERSION="$(google-chrome --version)" | |
CHROMEDRIVER_RELEASE="$(echo $CHROME_VERSION | sed 's/^Google Chrome //')" | |
CHROMEDRIVER_RELEASE=${CHROMEDRIVER_RELEASE%%.*} | |
php artisan dusk:chrome-driver $CHROMEDRIVER_RELEASE | |
- name: Start Chrome Driver | |
run: ./vendor/laravel/dusk/bin/chromedriver-linux & | |
- name: Run Laravel Server | |
run: php artisan serve & | |
- name: Run Laravel Dusk Tests | |
id: laravel-dusk | |
continue-on-error: true | |
run: php artisan dusk | |
- name: Upload logs | |
uses: actions/upload-artifact@v2 | |
if: ${{ steps.laravel-dusk.outcome == 'failure'}} | |
with: | |
name: ${{ env.job-name }}-log | |
path: ./storage/logs/*.log | |
- name: Upload screenshots | |
uses: actions/upload-artifact@v2 | |
if: ${{ steps.laravel-dusk.outcome == 'failure' }} | |
with: | |
name: ${{ env.job-name }}-screenshots | |
path: ./tests/Browser/screenshots | |
- name: Sanity check | |
if: ${{ steps.laravel-dusk.outcome == 'failure'}} | |
run: exit 2 |