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

Conversation

JhumanJ
Copy link
Owner

@JhumanJ JhumanJ commented Dec 12, 2023

To speed things up a bit, build client in another test.

Summary by CodeRabbit

  • Refactor

    • Renamed the job for backend testing to backend_tests for clarity.
  • New Features

    • Introduced a new job build_client to handle building the front-end client.
  • Chores

    • Updated the production-deploy job to include the new build_client job as a dependency, ensuring both backend tests and front-end build are completed before deployment.

Copy link
Contributor

coderabbitai bot commented Dec 12, 2023

Walkthrough

The GitHub Actions workflow for a Laravel project has been updated. The tests job has been renamed to backend_tests, indicating a possible distinction between backend and frontend testing. A new job build_client has been added, which suggests that the workflow now includes steps to build a front-end client. Additionally, the production-deploy job's dependencies have been updated to require both the backend_tests and build_client jobs to pass before it can run.

Changes

File Change Summary
.github/workflows/laravel.yml Renamed job from tests to backend_tests, added new job build_client for front-end build, and updated production-deploy job to depend on both backend_tests and build_client.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment from CodeRabbit.
  • You can also chat with CodeRabbit bot directly around the specific lines of code or files in the PR by tagging @coderabbitai in a new comment.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@JhumanJ JhumanJ closed this Dec 12, 2023
@JhumanJ JhumanJ deleted the split-client-test-gh-actions branch December 12, 2023 11:10
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 77ff863 and f6a5920.
Files selected for processing (1)
  • .github/workflows/laravel.yml (3 hunks)
Additional comments: 2
.github/workflows/laravel.yml (2)
  • 9-12: The renaming of the tests job to backend_tests is clear and aligns with the PR objectives to distinguish backend tests from other jobs.

  • 175-176: The update to the production-deploy job's dependencies to include both backend_tests and build_client is correct and aligns with the PR objectives to ensure both jobs pass before deployment.

Comment on lines +124 to +167
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
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant