Skip to content

Commit cb5d419

Browse files
committed
GHA: Split tests into three units of execution
1 parent 77fb166 commit cb5d419

6 files changed

Lines changed: 84 additions & 6 deletions

File tree

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ jobs:
1818
runs-on: ubuntu-latest
1919
timeout-minutes: 10
2020

21-
strategy:
22-
fail-fast: false
23-
2421
steps:
2522
- name: Checkout
2623
uses: actions/checkout@v4
@@ -56,4 +53,7 @@ jobs:
5653
- name: Test
5754
shell: bash
5855
run: |
59-
npm run test
56+
npm run test:install
57+
npx vitest --config ./.github/workflows/vitest/vitest.config.mer.ts --run
58+
npx vitest --config ./.github/workflows/vitest/vitest.config.mlc.ts --run
59+
npx vitest --config ./.github/workflows/vitest/vitest.config.mlce.ts --run
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* --------------------------------------------------------------------------------------------
2+
* Copyright (c) 2024 TypeFox and others.
3+
* Licensed under the MIT License. See LICENSE in the package root for license information.
4+
* ------------------------------------------------------------------------------------------ */
5+
6+
import { mergeConfig } from 'vite';
7+
import { defineConfig as defineVitestConfig } from 'vitest/config';
8+
import externalVitestConfig from '../../../vitest.config.js';
9+
10+
/// <reference lib="vitest/config" />
11+
12+
externalVitestConfig.test.include = [];
13+
export const localConfig = {
14+
test: {
15+
include: [
16+
'**/wrapper-react/test/**/*.test.tsx'
17+
]
18+
}
19+
};
20+
21+
const definedLocalVitestConfig = defineVitestConfig(localConfig);
22+
23+
export default mergeConfig(definedLocalVitestConfig, externalVitestConfig);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* --------------------------------------------------------------------------------------------
2+
* Copyright (c) 2024 TypeFox and others.
3+
* Licensed under the MIT License. See LICENSE in the package root for license information.
4+
* ------------------------------------------------------------------------------------------ */
5+
6+
import { mergeConfig } from 'vite';
7+
import { defineConfig as defineVitestConfig } from 'vitest/config';
8+
import externalVitestConfig from '../../../vitest.config.js';
9+
10+
/// <reference lib="vitest/config" />
11+
12+
externalVitestConfig.test.include = [];
13+
export const localConfig = {
14+
test: {
15+
include: [
16+
'**/client/test/**/*.test.ts'
17+
],
18+
exclude: [
19+
...externalVitestConfig.test.include,
20+
'**/client/test/editorApp/**/*'
21+
]
22+
}
23+
};
24+
25+
const definedLocalVitestConfig = defineVitestConfig(localConfig);
26+
27+
export default mergeConfig(definedLocalVitestConfig, externalVitestConfig);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* --------------------------------------------------------------------------------------------
2+
* Copyright (c) 2024 TypeFox and others.
3+
* Licensed under the MIT License. See LICENSE in the package root for license information.
4+
* ------------------------------------------------------------------------------------------ */
5+
6+
import { mergeConfig } from 'vite';
7+
import { defineConfig as defineVitestConfig } from 'vitest/config';
8+
import externalVitestConfig from '../../../vitest.config.js';
9+
10+
/// <reference lib="vitest/config" />
11+
12+
externalVitestConfig.test.include = [];
13+
export const localConfig = {
14+
test: {
15+
include: [
16+
'**/client/test/editorApp/**/*.test.ts'
17+
]
18+
}
19+
};
20+
21+
const definedLocalVitestConfig = defineVitestConfig(localConfig);
22+
23+
export default mergeConfig(definedLocalVitestConfig, externalVitestConfig);

vite.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ export const definedViteConfig = defineConfig({
6262
]
6363
},
6464
include: [
65+
'@codingame/monaco-vscode-standalone-languages',
66+
'@codingame/monaco-vscode-standalone-css-language-features',
67+
'@codingame/monaco-vscode-standalone-html-language-features',
68+
'@codingame/monaco-vscode-standalone-json-language-features',
69+
'@codingame/monaco-vscode-standalone-typescript-language-features',
6570
'@testing-library/react',
6671
'langium',
6772
'langium/lsp',

vitest.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { mergeConfig } from 'vite';
77
import { defineConfig as defineVitestConfig } from 'vitest/config';
8-
import definedViteConfig from './vite.config.js';
8+
import externalViteConfig from './vite.config.js';
99

1010
/// <reference lib="vitest/config" />
1111

@@ -53,5 +53,5 @@ export const vitestConfig = {
5353

5454
const definedVitestConfig = defineVitestConfig(vitestConfig);
5555

56-
export default mergeConfig(definedVitestConfig, definedViteConfig);
56+
export default mergeConfig(definedVitestConfig, externalViteConfig);
5757

0 commit comments

Comments
 (0)