Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split backend tests & client build #259

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 47 additions & 9 deletions .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

jobs:
tests:
backend_tests:
runs-on: ubuntu-latest

services:
Expand Down Expand Up @@ -86,13 +86,6 @@ jobs:
restore-keys: |
${{ runner.os }}-composer-

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand Down Expand Up @@ -128,14 +121,59 @@ jobs:
path: storage/logs/laravel.log
retention-days: 3

build_client:
runs-on: ubuntu-latest

name: Build front-end client

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Get Composer cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, mbstring, pdo, sqlite, pdo_sqlite
tools: composer:v2
coverage: none

- name: Prepare the environment
run: cp .env.example .env

- name: Install composer dependencies
run: composer install --prefer-dist --no-interaction --no-progress --ignore-platform-reqs --optimize-autoloader

- name: Directory permissions
run: chmod -R 777 storage bootstrap/cache
Comment on lines +124 to +167
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build_client job includes steps for setting up PHP and installing composer dependencies, which may not be necessary for building a front-end client. Verify if these steps are required for the client build process or if they can be removed to optimize the workflow.


- name: Install npm dependencies
run: npm install --no-audit --no-progress --silent

- name: Build client
run: npm run build

production-deploy:
needs: [ tests ]
needs: [ tests, build_client ]
if: success() && github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
strategy:
Expand Down