build: Bump laravel/horizon from 5.19.2 to 5.20.0 (#3231) #5246
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: | |
branches: | |
- '*' | |
- '**' | |
tags-ignore: | |
- v* | |
pull_request: | |
env: | |
NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }} | |
NOVA_PASSWORD: ${{ secrets.NOVA_PASSWORD }} | |
jobs: | |
test: | |
name: PHP ${{ matrix.php }} / Composer ${{ matrix.composer }} | |
runs-on: ubuntu-latest | |
concurrency: | |
group: core-test-${{ github.ref }} | |
cancel-in-progress: true | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: false | |
matrix: | |
php: ['8.1'] | |
composer: ['v2'] | |
experimental: [false] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
# | |
# ENVIRONMENT DEPENDENCIES SETUP | |
# | |
- name: Configure PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: pcov | |
tools: composer:${{ matrix.composer }} | |
- name: Setup Yarn | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
# Authenticate Nova | |
- name: Authenticate Nova Installation | |
env: | |
NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }} | |
NOVA_PASSWORD: ${{ secrets.NOVA_PASSWORD }} | |
run: | | |
cp auth.json.example auth.json | |
sed -i "s/your-username/${NOVA_USERNAME}/g" auth.json | |
sed -i "s/your-password/${NOVA_PASSWORD}/g" auth.json | |
# Start MySQL and Create Databases | |
- name: Create Databases | |
run: | | |
sudo systemctl start mysql.service | |
mysql -e 'CREATE DATABASE IF NOT EXISTS core;' -h127.0.0.1 -uroot -proot | |
mysql -e 'CREATE DATABASE IF NOT EXISTS core_testing;' -h127.0.0.1 -uroot -proot | |
mysql -e 'CREATE DATABASE IF NOT EXISTS cts;' -h127.0.0.1 -uroot -proot | |
# | |
# COMPOSER DEPENDENICES | |
# | |
# Add GitHub Auth to Composer | |
- name: Add Composer GitHub Token | |
run: composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} | |
# Restore Caches | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Restore Composer Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Restore Vendor From Cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }} | |
# Install | |
- name: Install Composer Dependencies | |
run: | | |
composer install --no-interaction | |
php artisan package:discover | |
- name: Install Nova & Waiting Lists | |
run: | | |
php artisan nova:install | |
cd nova-components/WaitingListsManager && composer install && cd ../../ | |
# | |
# YARN DEPENDENCIES | |
# | |
# Restore Caches | |
- name: Get Yarn Cache Directory | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Restore Yarn Cache | |
uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
# Install | |
- name: Install Core Assets | |
run: yarn | |
- name: Compile Core Assets | |
run: yarn run prod | |
- name: Install Waiting Lists Manager Assets | |
run: cd nova-components/WaitingListsManager && yarn && cd ../../ | |
- name: Compile Waiting Lists Manager Assets | |
run: cd nova-components/WaitingListsManager && yarn run prod && cd ../../ | |
# | |
# APPLICATION SETUP | |
# | |
# Environment Configuration | |
- name: Create Environment File | |
run: mv .env.ci .env | |
# Publish Packages | |
- name: Publish Horizon | |
run: php artisan horizon:publish | |
- name: Publish Telescope | |
run: php artisan telescope:publish | |
# Run Database Migration | |
- name: Migrate & Seed Database | |
run: php artisan migrate && php artisan cts:migrate:fresh | |
# Cache Setup | |
- name: Cache Routes | |
run: php artisan route:cache | |
- name: Cache Config | |
run: php artisan config:cache | |
# Start Application | |
- name: Serve Application | |
run: php artisan serve -q & | |
# | |
# RUN TESTING SUITE | |
# | |
# Run Tests | |
- name: Execute PHPUnit Tests With Coverage | |
run: vendor/bin/phpunit --coverage-clover=coverage.xml | |
# Run Coverage Suite | |
- name: Upload Code Coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
- name: Authenticate Nova Installation | |
env: | |
NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }} | |
NOVA_PASSWORD: ${{ secrets.NOVA_PASSWORD }} | |
run: | | |
cp auth.json.example auth.json | |
sed -i "s/your-username/${NOVA_USERNAME}/g" auth.json | |
sed -i "s/your-password/${NOVA_PASSWORD}/g" auth.json | |
- name: Install PHP dependencies | |
uses: ramsey/composer-install@v2 | |
- name: 'Lint PHP' | |
run: composer lint -- --test | |
trigger-deploy: | |
name: Trigger Deploy | |
needs: test | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
# | |
# RELEASE (main only) | |
# | |
- name: Trigger deploy workflow | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.PAT }} | |
event-type: deploy-trigger |