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

CI: Optimize CI workflow to run tests and linting only on relevant file changes #1149

Merged
merged 14 commits into from
Jul 1, 2024

Conversation

drikusroor
Copy link
Contributor

@drikusroor drikusroor commented Jun 25, 2024

The PR involves significant restructuring of the GitHub Actions workflows, splitting the original CI workflow into separate workflows for backend and frontend, and updating conditions for running certain actions. Additionally, minor changes are made to the Storybook workflow and a frontend component.

Changes in Workflows

1. Rename and Modify Backend Workflow

  • File renamed: .github/workflows/ci.yml to .github/workflows/ci-backend.yml
  • New Name: Backend Test & Lint
  • Trigger Conditions Updated:
    • Runs on push and pull_request events, but only if changes are made in the backend/** directory.
  • Removed Jobs: All frontend-related jobs have been removed from this workflow.

2. Create Separate Frontend Workflow

  • New File: .github/workflows/ci-frontend.yml

  • Name: Frontend Test & Lint

  • Trigger Conditions:

    • Runs on push and pull_request events, but only if changes are made in the frontend/** and the .yarn directory.
  • Jobs Added:

    • frontend-test: Runs frontend tests using Docker.
    • frontend-coverage-badge: Generates a frontend coverage badge and pushes it to a separate branch if on the develop branch.
    • frontend-lint: Lints frontend code using Docker.

3. Update Storybook Workflow

  • File Modified: .github/workflows/storybook.yml
  • Trigger Conditions Updated:
  • Runs on push and pull_request events for changes in the following paths:
    • frontend/**
    • .github/workflows/storybook.yml
    • .yarn/**
    • .storybook/**

Summary

  • Backend Workflow: Now exclusively handles backend tests and linting, triggered by changes in the backend directory.
  • Frontend Workflow: Introduced to handle frontend tests, coverage generation, and linting, triggered by changes in the frontend directory.
  • Storybook Workflow: Updated to be triggered by changes in specific frontend-related paths.
  • Code Change: Minor formatting change in the frontend App component to remove trailing whitespace.

@drikusroor drikusroor self-assigned this Jun 25, 2024
@drikusroor drikusroor force-pushed the ci/files-changed-filter branch 3 times, most recently from 65c07d8 to 4402b22 Compare July 1, 2024 09:05
…ile, .env-github-actions and docker-compose.yaml as conditions to run
@drikusroor drikusroor merged commit 8786e75 into develop Jul 1, 2024
15 checks passed
@drikusroor drikusroor deleted the ci/files-changed-filter branch July 1, 2024 12:30
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.

3 participants