Skip to content

Commit ab45566

Browse files
authored
chore: split ci test (#2731)
1 parent 5b7ad18 commit ab45566

File tree

57 files changed

+351
-153
lines changed

Some content is hidden

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

57 files changed

+351
-153
lines changed

.github/workflows/build-and-test.yml

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
name: Build affected packages
1+
name: Build Affected Packages
22

33
on:
44
pull_request:
55
branches: [main]
6-
76
push:
87
branches: [main]
98

109
jobs:
11-
main:
10+
checkout-install:
1211
runs-on: ubuntu-latest
1312
steps:
1413
- name: Checkout Repository
@@ -37,47 +36,33 @@ jobs:
3736
- name: Check Code Format
3837
run: npx nx format:check
3938

40-
- name: Update NX Build Cache
41-
run: npx nx run-many --targets=build --projects=tag:type:pkg
42-
4339
- name: Run Build for All
4440
run: npx nx run-many --targets=build --projects=tag:type:pkg --skip-nx-cache
4541

46-
- name: Run Affected Lint
47-
run: npx nx affected -t lint --parallel=7 --exclude='*,!tag:type:pkg'
48-
4942
- name: Run Affected Test
5043
run: npx nx affected -t test --parallel=2 --exclude='*,!tag:type:pkg' --skip-nx-cache
5144

52-
- name: E2E Test for ModernJS
53-
run: npx kill-port --port 3000,3001,3002 && npx nx run-many --target=test:e2e --projects=modernjs --parallel=1 && lsof -ti tcp:4001 | xargs kill
54-
55-
- name: E2E Test for 3005-runtime-host
56-
run: npx kill-port --port 3005,3006,3007 && pnpm run app:runtime:dev & echo "done" && sleep 20 && npx nx run-many --target=test:e2e --projects=3005-runtime-host --parallel=1 && lsof -ti tcp:3005,3006,3007 | xargs kill
57-
58-
- name: E2E Test for 3008-webpack-host
59-
run: pnpm run app:manifest:dev & echo "done" && npx wait-on tcp:3009 && npx wait-on tcp:3012 && npx nx run-many --target=e2e --projects=3008-webpack-host --parallel=1 && lsof -ti tcp:3008,3009,3010,3011,3012 | xargs kill
60-
61-
- name: E2E Node Federation
62-
run: npx nx run-many --target=serve --projects=node-local-remote,node-remote,node-dynamic-remote-new-version,node-dynamic-remote --parallel=10 & echo "done" && sleep 25 && npx nx run-many --target=serve --projects=node-host & sleep 5 && npx wait-on tcp:3333 && npx nx run node-host-e2e:test:e2e
63-
64-
- name: E2E Test for Next.js Prod
65-
run: |
66-
pnpm run --filter @module-federation/3002-checkout --filter @module-federation/3000-home --filter @module-federation/3001-shop build &&
67-
pnpm run app:next:prod &
68-
sleep 2 &&
69-
npx wait-on tcp:3001 &&
70-
npx wait-on tcp:3002 &&
71-
npx wait-on tcp:3000 &&
72-
npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=3 &&
73-
lsof -ti tcp:3000,3001,3002 | xargs kill
74-
75-
- name: E2E Test for Next.js Dev
76-
run: |
77-
pnpm run app:next:dev > /dev/null 2>&1 &
78-
sleep 1 &&
79-
npx wait-on tcp:3001 &&
80-
npx wait-on tcp:3002 &&
81-
npx wait-on tcp:3000 &&
82-
npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=1 &&
83-
lsof -ti tcp:3000,3001,3002 | xargs kill
45+
e2e-modern:
46+
needs: checkout-install
47+
uses: ./.github/workflows/e2e-modern.yml
48+
secrets: inherit
49+
50+
e2e-runtime:
51+
needs: checkout-install
52+
uses: ./.github/workflows/e2e-runtime.yml
53+
secrets: inherit
54+
55+
e2e-manifest:
56+
needs: checkout-install
57+
uses: ./.github/workflows/e2e-manifest.yml
58+
secrets: inherit
59+
60+
e2e-node:
61+
needs: checkout-install
62+
uses: ./.github/workflows/e2e-node.yml
63+
secrets: inherit
64+
65+
e2e-next:
66+
needs: checkout-install
67+
uses: ./.github/workflows/e2e-next.yml
68+
secrets: inherit

.github/workflows/e2e-manifest.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# .github/workflows/e2e-webpack-host.yml
2+
name: E2E Test for Manifest
3+
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
e2e-manifest:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Install Pnpm
17+
run: corepack enable
18+
19+
- name: Setup Node.js 18
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '18'
23+
cache: 'pnpm'
24+
25+
- name: Set Nx SHA
26+
uses: nrwl/nx-set-shas@v3
27+
28+
- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
29+
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV
30+
31+
- name: Install Dependencies
32+
run: pnpm install
33+
34+
- name: Install Cypress
35+
run: npx cypress install
36+
37+
- name: Run Build for All
38+
run: npx nx run-many --targets=build --projects=tag:type:pkg
39+
40+
- name: Run condition check script
41+
id: check-ci
42+
run: node tools/scripts/ci-is-affected.mjs --appName=manifest-webpack-host
43+
44+
- name: E2E Test for Manifest Demo
45+
if: steps.check-ci.outcome == 'success'
46+
run: pnpm run app:manifest:dev & echo "done" && npx wait-on tcp:3009 && npx wait-on tcp:3012 && npx nx run-many --target=e2e --projects=manifest-webpack-host --parallel=1 && lsof -ti tcp:3013,3009,3010,3011,3012 | xargs kill

.github/workflows/e2e-modern.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# .github/workflows/e2e-modernjs.yml
2+
name: E2E Test for ModernJS
3+
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
e2e-modern:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Install Pnpm
17+
run: corepack enable
18+
19+
- name: Setup Node.js 18
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '18'
23+
cache: 'pnpm'
24+
25+
- name: Set Nx SHA
26+
uses: nrwl/nx-set-shas@v3
27+
28+
- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
29+
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV
30+
31+
- name: Install Dependencies
32+
run: pnpm install
33+
34+
- name: Install Cypress
35+
run: npx cypress install
36+
37+
- name: Run Build for All
38+
run: npx nx run-many --targets=build --projects=tag:type:pkg
39+
40+
- name: Run condition check script
41+
id: check-ci
42+
run: node tools/scripts/ci-is-affected.mjs --appName=modernjs
43+
44+
- name: E2E Test for ModernJS
45+
if: steps.check-ci.outcome == 'success'
46+
run: npx kill-port --port 4001 && npx nx run-many --target=test:e2e --projects=modernjs --parallel=1 && lsof -ti tcp:4001 | xargs kill

.github/workflows/e2e-next.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# .github/workflows/e2e-next-dev.yml
2+
name: E2E Test for Next.js Dev
3+
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
e2e-next:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Install Pnpm
17+
run: corepack enable
18+
19+
- name: Setup Node.js 18
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '18'
23+
cache: 'pnpm'
24+
25+
- name: Set Nx SHA
26+
uses: nrwl/nx-set-shas@v3
27+
28+
- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
29+
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV
30+
31+
- name: Install Dependencies
32+
run: pnpm install
33+
34+
- name: Install Cypress
35+
run: npx cypress install
36+
37+
- name: Run Build for All
38+
run: npx nx run-many --targets=build --projects=tag:type:pkg
39+
40+
- name: Run condition check script
41+
id: check-ci
42+
run: node tools/scripts/ci-is-affected.mjs --appName=3000-home
43+
44+
- name: E2E Test for Next.js Prod
45+
if: steps.check-ci.outcome == 'success'
46+
run: |
47+
pnpm run --filter @module-federation/3002-checkout --filter @module-federation/3000-home --filter @module-federation/3001-shop build &&
48+
pnpm run app:next:prod &
49+
sleep 2 &&
50+
npx wait-on tcp:3001 &&
51+
npx wait-on tcp:3002 &&
52+
npx wait-on tcp:3000 &&
53+
npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=3 &&
54+
lsof -ti tcp:3000,3001,3002 | xargs kill
55+
56+
- name: E2E Test for Next.js Dev
57+
if: steps.check-ci.outcome == 'success'
58+
run: |
59+
pnpm run app:next:dev > /dev/null 2>&1 &
60+
sleep 1 &&
61+
npx wait-on tcp:3001 &&
62+
npx wait-on tcp:3002 &&
63+
npx wait-on tcp:3000 &&
64+
npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=1 &&
65+
lsof -ti tcp:3000,3001,3002 | xargs kill

.github/workflows/e2e-node.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# .github/workflows/e2e-node-federation.yml
2+
name: E2E Node Federation
3+
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
e2e-node:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Install Pnpm
17+
run: corepack enable
18+
19+
- name: Setup Node.js 18
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '18'
23+
cache: 'pnpm'
24+
25+
- name: Set Nx SHA
26+
uses: nrwl/nx-set-shas@v3
27+
28+
- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
29+
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV
30+
31+
- name: Install Dependencies
32+
run: pnpm install
33+
34+
- name: Install Cypress
35+
run: npx cypress install
36+
37+
- name: Run Build for All
38+
run: npx nx run-many --targets=build --projects=tag:type:pkg
39+
40+
- name: Run condition check script
41+
id: check-ci
42+
run: node tools/scripts/ci-is-affected.mjs --appName=node-local-remote,node-remote,node-dynamic-remote-new-version,node-dynamic-remote
43+
44+
- name: E2E Node Federation
45+
if: steps.check-ci.outcome == 'success'
46+
run: npx nx run-many --target=serve --projects=node-local-remote,node-remote,node-dynamic-remote-new-version,node-dynamic-remote --parallel=10 & echo "done" && sleep 25 && npx nx run-many --target=serve --projects=node-host & sleep 5 && npx wait-on tcp:3333 && npx nx run node-host-e2e:test:e2e

.github/workflows/e2e-runtime.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# .github/workflows/e2e-runtime-host.yml
2+
name: E2E Test for Runtime
3+
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
e2e-runtime:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Install Pnpm
17+
run: corepack enable
18+
19+
- name: Setup Node.js 18
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '18'
23+
cache: 'pnpm'
24+
25+
- name: Set Nx SHA
26+
uses: nrwl/nx-set-shas@v3
27+
28+
- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
29+
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV
30+
31+
- name: Install Dependencies
32+
run: pnpm install
33+
34+
- name: Install Cypress
35+
run: npx cypress install
36+
37+
- name: Run Build for All
38+
run: npx nx run-many --targets=build --projects=tag:type:pkg
39+
40+
- name: Run condition check script
41+
id: check-ci
42+
run: node tools/scripts/ci-is-affected.mjs --appName=3005-runtime-host
43+
44+
- name: E2E Test for Runtime Demo
45+
if: steps.check-ci.outcome == 'success'
46+
run: npx kill-port --port 3005,3006,3007 && pnpm run app:runtime:dev & echo "done" && sleep 20 && npx nx run-many --target=test:e2e --projects=3005-runtime-host --parallel=1 && lsof -ti tcp:3005,3006,3007 | xargs kill

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ packages/enhanced/test/js
5959
**/.mf/**
6060

6161
/apps/manifest-demo/**/@mf-types/
62-
/apps/manifest-demo/3008-webpack-host/@mf-types/
62+
/apps/manifest-demo/webpack-host/@mf-types/

apps/manifest-demo/3008-webpack-host/@mf-types/index.d.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

apps/manifest-demo/3008-webpack-host/@mf-types/js-entry-provider/Component.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

apps/manifest-demo/3008-webpack-host/@mf-types/js-entry-provider/compiled-types/apps/manifest-demo/3012-rspack-js-entry-provider/src/App.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)