WikiEducationFoundation / WikiEduDashboard

Wiki Education Foundation's Wikipedia course dashboard system
https://dashboard.wikiedu.org
MIT License
386 stars 620 forks source link

Optimizing Workflow and Rspec Test Suite #5720

Open prathamVaidya opened 6 months ago

prathamVaidya commented 6 months ago

What is happening?

The ci.yml workflow file for Continuous Integration (CI) serves the purpose of executing tests and identifying linting errors. Currently, this workflow typically consumes approximately 35 minutes to execute. An average of 30 minutes is used by the RSpec test suite. We can perform multiple optimizations on the workflow and rspec test suite to reduce this time and improve the overall development process.

Possible Workflow Optimizations:

1. Separate workflow steps depending on file changes

There is no need to run RSpec tests if only a javascript file or some .md file has changed. We can filter the steps based on file changes using dorny/paths-filter@v3 workflow action. I have opened a PR for this.

2. Running Steps Concurrently

While executing parallel steps is not supported by Github, a custom script can be written to run some steps parallel to reduce workflow time. Refer to this Discussion

Possible RSpec Optimizations:

These are time-consuming but can be slowly started