-
Notifications
You must be signed in to change notification settings - Fork 467
65 lines (56 loc) · 2.24 KB
/
frontend.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Frontend
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- 'core-web/**'
env:
EXCLUDED_PROJECTS: dot-rules,dot-layout-grid,dot-primeng-theme-styles,dot-rules,dotcms,dotcms-field-elements,dotcms-js,dotcms-models,dotcms-webcomponents,dotcdn-e2e,dotcms-block-editor,dotcms-block-editor-e2e,dotcms-ui-e2e,utils-testing,block-editor,utils,dojo-theme
jobs:
check-all:
outputs:
name: ${{ steps.lint.outputs.name || steps.test.outputs.name || steps.build.outputs.name }}
status: ${{ steps.lint.outputs.status || steps.test.outputs.status || steps.build.outputs.status }}
color: ${{ steps.lint.outputs.color || steps.test.outputs.color || steps.build.outputs.color }}
message: ${{ steps.persist_results.outputs.message }}
runs-on: ubuntu-20.04
strategy:
matrix:
task:
- lint
- test
- build
name: Frontend Checks
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18.17.0
cache: yarn
cache-dependency-path: 'core-web/yarn.lock'
- name: Install Dependencies
run: yarn --frozen-lockfile
working-directory: core-web
- name: Run Nx Affected ${{ matrix.task }}
working-directory: core-web
run: |
if [ "${{ matrix.task }}" = "test" ] || [ "${{ matrix.task }}" = "lint" ]; then
exclude_option="--exclude=${{ env.EXCLUDED_PROJECTS }}"
if ! (npx nx affected --target=${{ matrix.task }} --base=origin/master --head=HEAD --parallel $exclude_option) then
echo "name=:x: ${{ matrix.task }}" >>$GITHUB_OUTPUT
echo "status=failure" >>$GITHUB_OUTPUT
echo "color=#ff2400" >>$GITHUB_OUTPUT
exit 1;
fi
elif [ "${{ matrix.task }}" = "build" ]; then
if ! (npx nx build dotcms-ui) then
echo "name=:x: ${{ matrix.task }}" >>$GITHUB_OUTPUT
echo "status=failure" >>$GITHUB_OUTPUT
echo "color=#ff2400" >>$GITHUB_OUTPUT
exit 1;
fi
fi