Skip to content
Snippets Groups Projects
Unverified Commit 02a0143d authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Optimize the frontend CI workflow (#33269)

We're currently running way too many jobs on every single commit in CI.

Frontend code coverage is a good example.
We can safely move it to run only on the merge to master.

Experimental run showed that running FE unit tests without the coverage takes 22 minutes.
The run with the coverage takes ~33 minutes on the same machine.

Furthermore, we don't have to run Chromatic on every single run.
On merge to master should be more than enough.
parent ebf47f88
No related branches found
No related tags found
No related merge requests found
......@@ -38,8 +38,8 @@ jobs:
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- run: yarn run lint-prettier
name: Run Prettier formatting linter
- name: Run Prettier formatting linter
run: yarn run lint-prettier
fe-linter-eslint:
needs: files-changed
......@@ -54,8 +54,8 @@ jobs:
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'cljs'
- run: yarn run lint-eslint
name: Run ESLint linter
- name: Run ESLint linter
run: yarn run lint-eslint
fe-type-check:
needs: files-changed
......@@ -88,9 +88,14 @@ jobs:
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'cljs'
- run: yarn run test-unit --coverage --silent
name: Run frontend unit tests
- name: Run frontend unit tests and collect the code coverage information
if: github.ref_name == 'master'
run: yarn run test-unit --coverage --silent
- name: Run frontend unit tests
if: github.ref_name != 'master'
run: yarn run test-unit
- name: Upload coverage to codecov.io
if: github.ref_name == 'master'
uses: codecov/codecov-action@v3
with:
files: ./coverage/lcov.info
......@@ -109,12 +114,12 @@ jobs:
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'cljs'
- run: yarn run test-timezones
name: Run frontend timezones tests
- name: Run frontend timezones tests
run: yarn run test-timezones
fe-chromatic:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.frontend_all == 'true'
if: github.ref_name == 'master' && needs.files-changed.outputs.frontend_all == 'true'
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment