-
Notifications
You must be signed in to change notification settings - Fork 11
169 lines (144 loc) · 4.84 KB
/
monorepo-main-suite.yaml
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Main Suite
on:
# Avoid using `pull_request_target`, to prevent insecure actions
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
pull_request:
branches:
- "**"
push:
branches:
- main
- dev
concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
# Cancel in-progress runs when a new workflow with the same group name is triggered
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Monorepo
uses: team-monite/setup-yarn-project-action@c098d54db6f34eb2103eb9cceda484984e8b9bbe
- name: Build
run: yarn build
lint:
needs: build
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Monorepo
uses: team-monite/setup-yarn-project-action@c098d54db6f34eb2103eb9cceda484984e8b9bbe
- name: Lint
run: yarn lint
type-checking:
needs: build
name: Type Checking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Monorepo
uses: team-monite/setup-yarn-project-action@c098d54db6f34eb2103eb9cceda484984e8b9bbe
- name: Type Check
run: yarn typecheck
build-storybook:
needs: type-checking
name: Build Storybook
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Monorepo
uses: team-monite/setup-yarn-project-action@c098d54db6f34eb2103eb9cceda484984e8b9bbe
- name: Build Storybook
run: yarn storybook:build
unit-testing:
needs: build
name: Unit Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Monorepo
uses: team-monite/setup-yarn-project-action@c098d54db6f34eb2103eb9cceda484984e8b9bbe
- name: Unit Test
run: yarn test
e2e-testing:
needs: build
name: E2E Playwright Testing
environment: common
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Setup Monorepo
uses: team-monite/setup-yarn-project-action@c098d54db6f34eb2103eb9cceda484984e8b9bbe
- name: Install Playwright Browsers
run: yarn workspace @monite/sdk-drop-in exec playwright install
- name: E2E Test
run: yarn e2e
env:
MONITE_E2E_APP_ADMIN_CONFIG_JSON: ${{ secrets.MONITE_E2E_APP_ADMIN_CONFIG_JSON }}
translations-validation:
needs: build
name: Translations Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Monorepo
uses: team-monite/setup-yarn-project-action@c098d54db6f34eb2103eb9cceda484984e8b9bbe
- name: Translations Validator
run: ./lingui-translations-validator.sh
files-changed:
name: Checking modified files
runs-on: ubuntu-latest
outputs:
e2e-npm-tests-dependencies: ${{ steps.changes.outputs.e2e-npm-tests-dependencies }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
e2e-npm-tests-dependencies:
- 'packages/sdk-react/**'
- 'packages/rollup-config/**'
- 'e2e/**'
- 'package.json'
- 'yarn.lock'
- '.changeset/**'
e2e-npm-testing:
name: E2E NPM Testing
if: needs.files-changed.outputs.e2e-npm-tests-dependencies == 'true'
needs: [ build, files-changed ]
runs-on: ubuntu-latest
env:
NPM_PUBLISH_REGISTRY: 'http://localhost:4873'
UNSAFE_HTTP_WHITELIST: 'localhost'
steps:
- uses: actions/checkout@v4
- name: Setup Monorepo
uses: team-monite/setup-yarn-project-action@c098d54db6f34eb2103eb9cceda484984e8b9bbe
- name: Build
run: yarn build
- name: Export projects directory environment variable
id: export-projects-directory
run: echo "path=${{ runner.temp }}/projects" >> $GITHUB_OUTPUT
- name: Copy Playground for E2E Tests
run: |
mkdir -p "$TEST_PROJECTS_DIR"
cp -a e2e/projects/. "$TEST_PROJECTS_DIR/"
env:
TEST_PROJECTS_DIR: "${{ steps.export-projects-directory.outputs.path }}"
- name: Publish to Private Registry
run: yarn run "e2e:publish-to-private-registry"
env:
TEST_PROJECTS_DIR: "${{ steps.export-projects-directory.outputs.path }}"
- name: Update Projects from Private Registry
run: yarn run "e2e:update-projects-from-private-registry"
env:
TEST_PROJECTS_DIR: "${{ steps.export-projects-directory.outputs.path }}"
- name: Build E2E Projects
run: yarn run "e2e:build-projects"
env:
TEST_PROJECTS_DIR: "${{ steps.export-projects-directory.outputs.path }}"