Skip to content

Commit 37fd8dc

Browse files
committed
Merge branch 'main' into module-banner
2 parents ae653de + 0bef597 commit 37fd8dc

File tree

341 files changed

+6623
-6018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

341 files changed

+6623
-6018
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Description Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened, ready_for_review]
6+
7+
jobs:
8+
check-description:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/github-script@v6
12+
with:
13+
script: |
14+
const prBody = context?.payload?.pull_request?.body;
15+
const descriptionSubtitle = "Changes proposed in this pull request";
16+
const subString = prBody.substring(prBody.search(/Changes proposed in this pull request/) + descriptionSubtitle.length, prBody.search(/Related issue/));
17+
const regExp = /[a-zA-Z]/g;
18+
if(regExp.test(subString)){
19+
core.info('SUCCESS: Some description found');
20+
} else {
21+
core.setFailed('FAILED: No description found!');
22+
}

.github/workflows/pr-dod-check.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Definition of done Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened, ready_for_review]
6+
7+
jobs:
8+
check-unchecked-tasks:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/github-script@v6
12+
with:
13+
script: |
14+
const getPendingTasks = (body) => {
15+
let responseString = "";
16+
try {
17+
const uncompletedTasks = body.match(/(- \[[ ]\].+)/g);
18+
if (uncompletedTasks != undefined) {
19+
responseString += 'Uncompleted Tasks\n';
20+
uncompletedTasks.forEach(u => {
21+
responseString += `${u}\n`;
22+
});
23+
}
24+
} catch (e) {
25+
responseString = "";
26+
}
27+
return responseString;
28+
}
29+
(async () => {
30+
try {
31+
const prBody = context?.payload?.pull_request?.body;
32+
if (!prBody) {
33+
core.info("PR don't have tasks to check");
34+
return
35+
}
36+
core.debug('Getting a list of uncompleted tasks: ');
37+
let pendingTasks = getPendingTasks(prBody);
38+
core.debug(pendingTasks);
39+
let isTaskListCompleted = false;
40+
if (!pendingTasks) {
41+
isTaskListCompleted = true;
42+
}
43+
core.debug(`All tasks completed: ${isTaskListCompleted}`);
44+
45+
if (isTaskListCompleted) {
46+
core.info(`SUCCESS: All tasks completed`);
47+
return;
48+
} else {
49+
core.setFailed(`FAILED: Some tasks are still pending! \n${pendingTasks}\nLength: ${pendingTasks.length}`);
50+
}
51+
} catch (error) {
52+
core.setFailed(error.message)
53+
}
54+
})();
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Check linked issues
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened, ready_for_review]
6+
7+
jobs:
8+
check-linked-issue:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: read
12+
steps:
13+
- uses: nearform-actions/github-action-check-linked-issues@v1
14+
id: check-linked-issues
15+
with:
16+
comment: false
17+
- name: Get the output
18+
run: echo "Number of linked issues ${{ steps.check-linked-issues.outputs.linked_issues_count }}"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PR Title Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened, ready_for_review]
6+
7+
jobs:
8+
check-pr-type:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: amannn/action-semantic-pull-request@47b15d52c5c30e94a17ec87eb8dd51ff5221fed9
12+
env:
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
with:
15+
types: |
16+
feat
17+
fix
18+
docs
19+
refactor
20+
test
21+
chore
22+
requireScope: false
23+
subjectPattern: ^([A-Z].*[^.]|bump .*)$

.github/workflows/pull-integration-cluster-k3d.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ jobs:
1616
runs-on: ubuntu-latest
1717
if: github.event.pull_request.draft == false
1818
steps:
19-
- name: Install Chrome # this step could be removed after https://github.com/cypress-io/cypress/issues/30374 is resolved
20-
shell: bash
21-
run: |
22-
wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_127.0.6533.119-1_amd64.deb
23-
sudo apt install --allow-downgrades -y /tmp/chrome.deb
24-
rm /tmp/chrome.deb
2519
- uses: gardenlinux/workflow-telemetry-action@v2
2620
with:
2721
comment_on_pr: false

.github/workflows/pull-integration-namespace-k3d.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ jobs:
1616
runs-on: ubuntu-latest
1717
if: github.event.pull_request.draft == false
1818
steps:
19-
- name: Install Chrome
20-
shell: bash
21-
run: |
22-
wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_127.0.6533.119-1_amd64.deb
23-
sudo apt install --allow-downgrades -y /tmp/chrome.deb
24-
rm /tmp/chrome.deb
2519
- uses: gardenlinux/workflow-telemetry-action@v2
2620
with:
2721
comment_on_pr: false
Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
name: PR Unit Tests
1+
name: PR Unit and Component Tests
22

3-
on:
3+
on:
44
pull_request:
55
types: [opened, edited, synchronize, reopened, ready_for_review]
66
paths:
7-
- ".github/workflows/pull-unit-tests.yml"
8-
- "public/**"
9-
- "src/**"
10-
- "package.json"
7+
- '.github/workflows/pull-unit-tests.yml'
8+
- 'public/**'
9+
- 'src/**'
10+
- 'backend/**'
11+
- 'package.json'
12+
- 'cypress/**'
13+
- 'cypress.config.component.ts'
1114

1215
jobs:
13-
run-unit-test:
16+
run-unit-and-component-test:
1417
runs-on: ubuntu-latest
1518
if: github.event.pull_request.draft == false
1619
steps:
@@ -27,7 +30,11 @@ jobs:
2730
run: |
2831
set -e
2932
npm ci
30-
- name: run_tests
33+
- name: run_unit_tests
3134
shell: bash
32-
run: |
35+
run: |
3336
npm run test
37+
- name: run_component_tests
38+
shell: bash
39+
run: |
40+
npm run component-test-headless

cypress.config.component.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { defineConfig } from 'cypress';
2+
3+
export default defineConfig({
4+
component: {
5+
screenshotOnRunFailure: false,
6+
includeShadowDom: true,
7+
devServer: {
8+
framework: 'react',
9+
bundler: 'vite',
10+
},
11+
specPattern: 'src/**/*.cy.{js,jsx,ts,tsx}',
12+
supportFile: 'cypress/support/component.jsx',
13+
},
14+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
7+
<title>Components App</title>
8+
</head>
9+
<body>
10+
<div data-cy-root></div>
11+
</body>
12+
</html>

cypress/support/component.jsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* global Cypress */
2+
import React from 'react';
3+
import { mount } from 'cypress/react18';
4+
import { ThemeProvider } from '@ui5/webcomponents-react';
5+
import { MemoryRouter } from 'react-router-dom';
6+
import { RecoilRoot } from 'recoil';
7+
8+
import i18n from 'i18next';
9+
import { initReactI18next } from 'react-i18next';
10+
import { I18nextProvider } from 'react-i18next';
11+
12+
i18n.use(initReactI18next).init({
13+
lng: 'en',
14+
fallbackLng: false,
15+
nsSeparator: '::',
16+
defaultNS: 'translation',
17+
saveMissing: true,
18+
interpolation: {
19+
escapeValue: false,
20+
},
21+
});
22+
23+
Cypress.Commands.add(
24+
'mount',
25+
(component, { initializeRecoil, ...options } = {}) => {
26+
return mount(
27+
<RecoilRoot initializeState={initializeRecoil}>
28+
<I18nextProvider i18n={i18n}>
29+
<MemoryRouter>
30+
<ThemeProvider>{component}</ThemeProvider>
31+
</MemoryRouter>
32+
</I18nextProvider>
33+
</RecoilRoot>,
34+
options,
35+
);
36+
},
37+
);

0 commit comments

Comments
 (0)