Skip to content
Snippets Groups Projects
Unverified Commit aaa758bc authored by Vamsi Peri's avatar Vamsi Peri Committed by GitHub
Browse files

Run chromatic CI job when there is a label called chromatic (#33462)

* Run chromatic CI job when there is a label called chromatic

* Fix: Run chromatic job when one of the labels is chromatic
parent 1b37235b
No related branches found
No related tags found
No related merge requests found
...@@ -3,8 +3,8 @@ name: Frontend ...@@ -3,8 +3,8 @@ name: Frontend
on: on:
push: push:
branches: branches:
- 'master' - "master"
- 'release-**' - "release-**"
pull_request: pull_request:
types: [opened, synchronize, reopened, ready_for_review] types: [opened, synchronize, reopened, ready_for_review]
...@@ -35,11 +35,11 @@ jobs: ...@@ -35,11 +35,11 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Prepare front-end environment - name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend uses: ./.github/actions/prepare-frontend
- name: Run Prettier formatting linter - name: Run Prettier formatting linter
run: yarn run lint-prettier run: yarn run lint-prettier
fe-linter-eslint: fe-linter-eslint:
needs: files-changed needs: files-changed
...@@ -47,15 +47,15 @@ jobs: ...@@ -47,15 +47,15 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
timeout-minutes: 20 timeout-minutes: 20
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Prepare front-end environment - name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment - name: Prepare back-end environment
uses: ./.github/actions/prepare-backend uses: ./.github/actions/prepare-backend
with: with:
m2-cache-key: 'cljs' m2-cache-key: "cljs"
- name: Run ESLint linter - name: Run ESLint linter
run: yarn run lint-eslint run: yarn run lint-eslint
fe-type-check: fe-type-check:
needs: files-changed needs: files-changed
...@@ -63,17 +63,17 @@ jobs: ...@@ -63,17 +63,17 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Prepare front-end environment - name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment - name: Prepare back-end environment
uses: ./.github/actions/prepare-backend uses: ./.github/actions/prepare-backend
with: with:
m2-cache-key: 'cljs' m2-cache-key: "cljs"
- run: yarn build:cljs - run: yarn build:cljs
name: Compile CLJS name: Compile CLJS
- run: yarn type-check - run: yarn type-check
name: Check types name: Check types
fe-tests-unit: fe-tests-unit:
needs: files-changed needs: files-changed
...@@ -81,25 +81,25 @@ jobs: ...@@ -81,25 +81,25 @@ jobs:
runs-on: buildjet-2vcpu-ubuntu-2204 runs-on: buildjet-2vcpu-ubuntu-2204
timeout-minutes: 60 timeout-minutes: 60
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Prepare front-end environment - name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment - name: Prepare back-end environment
uses: ./.github/actions/prepare-backend uses: ./.github/actions/prepare-backend
with: with:
m2-cache-key: 'cljs' m2-cache-key: "cljs"
- name: Run frontend unit tests and collect the code coverage information - name: Run frontend unit tests and collect the code coverage information
if: github.ref_name == 'master' if: github.ref_name == 'master'
run: yarn run test-unit --coverage --silent run: yarn run test-unit --coverage --silent
- name: Run frontend unit tests - name: Run frontend unit tests
if: github.ref_name != 'master' if: github.ref_name != 'master'
run: yarn run test-unit run: yarn run test-unit
- name: Upload coverage to codecov.io - name: Upload coverage to codecov.io
if: github.ref_name == 'master' if: github.ref_name == 'master'
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v3
with: with:
files: ./coverage/lcov.info files: ./coverage/lcov.info
flags: front-end flags: front-end
fe-tests-timezones: fe-tests-timezones:
needs: files-changed needs: files-changed
...@@ -107,19 +107,19 @@ jobs: ...@@ -107,19 +107,19 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
timeout-minutes: 20 timeout-minutes: 20
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Prepare front-end environment - name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment - name: Prepare back-end environment
uses: ./.github/actions/prepare-backend uses: ./.github/actions/prepare-backend
with: with:
m2-cache-key: 'cljs' m2-cache-key: "cljs"
- name: Run frontend timezones tests - name: Run frontend timezones tests
run: yarn run test-timezones run: yarn run test-timezones
fe-chromatic: fe-chromatic:
needs: files-changed needs: files-changed
if: github.ref_name == 'master' && needs.files-changed.outputs.frontend_all == 'true' if: contains(github.event.pull_request.labels.*.name, 'chromatic') || (github.ref_name == 'master' && needs.files-changed.outputs.frontend_all == 'true')
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout repository - name: Checkout repository
...@@ -131,7 +131,7 @@ jobs: ...@@ -131,7 +131,7 @@ jobs:
- name: Prepare back-end environment - name: Prepare back-end environment
uses: ./.github/actions/prepare-backend uses: ./.github/actions/prepare-backend
with: with:
m2-cache-key: 'cljs' m2-cache-key: "cljs"
- name: Publish to Chromatic - name: Publish to Chromatic
uses: chromaui/action@v1 uses: chromaui/action@v1
env: env:
......
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