-
Notifications
You must be signed in to change notification settings - Fork 212
113 lines (95 loc) · 3.45 KB
/
lint.yml
File metadata and controls
113 lines (95 loc) · 3.45 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# WARNING! Conditionals are set as variables to minimize repetitive checks.
# However, this results in the variables being the *string* values "true" or "false".
# As a result, you must always explicitly check for those strings. For example,
# ${{ env.DEVELOP }} will ALWAYS evaluate as true; to achieve the expected result
# you must check ${{ env.DEVELOP == 'true' }}. There's probably a better way to DRY,
# but this is what we have for now.
name: SalesforceCommerceCloud/pwa-kit/lint
on:
pull_request: # Default: opened, reopened, synchronize (head branch updated)
merge_group: # Trigger GA workflow when a pull request is added to a merge queue.
push:
branches:
- develop
- 'release-*'
jobs:
pwa-kit-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24 # Use latest LTS version for linting
cache: npm
- name: Setup Ubuntu Machine
uses: "./.github/actions/setup_ubuntu"
- name: Run linting
uses: "./.github/actions/linting"
generated-project-lint:
strategy:
fail-fast: false
matrix:
template: [retail-react-app-test-project, retail-react-app-demo]
runs-on: ubuntu-latest
env:
PROJECT_DIR: generated-${{ matrix.template }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Setup Ubuntu Machine
uses: "./.github/actions/setup_ubuntu"
- name: Generate ${{ matrix.template }} project
run: |-
node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir ${{ env.PROJECT_DIR }}
env:
GENERATOR_PRESET: ${{ matrix.template }}
timeout-minutes: 8
- name: Lint the generated project
uses: "./.github/actions/linting"
with:
cwd: ${{ env.PROJECT_DIR }}
- name: Store Verdaccio logfile artifact
uses: actions/upload-artifact@v4
with:
name: verdaccio-log-lint-${{ matrix.template }}
path: packages/pwa-kit-create-app/local-npm-repo/verdaccio-${{ matrix.template }}.log
generated-project-lint-windows:
strategy:
fail-fast: false
matrix:
template: [retail-react-app-test-project, retail-react-app-demo]
runs-on: windows-latest
env:
PROJECT_DIR: generated-${{ matrix.template }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Setup Windows Machine
uses: "./.github/actions/setup_windows"
- name: Generate ${{ matrix.template }} project
run: |-
node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir ${{ env.PROJECT_DIR }}
env:
GENERATOR_PRESET: ${{ matrix.template }}
timeout-minutes: 7
- name: Lint the generated project
uses: "./.github/actions/linting"
with:
cwd: ${{ env.PROJECT_DIR }}
- name: Store Verdaccio logfile artifact
uses: actions/upload-artifact@v4
with:
name: verdaccio-log-lint-windows-${{ matrix.template }}
path: packages/pwa-kit-create-app/local-npm-repo/verdaccio-windows-${{ matrix.template }}.log