Skip to content

Commit ca91c29

Browse files
authoredNov 30, 2024··
Change pipeline workflow (#59)
* Updated gitignore * Changed CI to use reusable workflow * Combined build and test since with need to build before testing * Typo * Tried to split more the files * Display the workflow run name correctly * Update job names * Removed the build-and-test workflow * Cannot wait for build inside the tests workflow * Removed the . in the description
1 parent 7d3e411 commit ca91c29

File tree

6 files changed

+111
-161
lines changed

6 files changed

+111
-161
lines changed
 

‎.github/workflows/dotnet.yml

+4-78
Original file line numberDiff line numberDiff line change
@@ -11,90 +11,16 @@ on:
1111

1212
jobs:
1313
build:
14-
name: Builds the entire solution
15-
runs-on: windows-latest
14+
name: Build the entire solution
15+
uses: ./.github/workflows/workflow-build.yml
1616

17-
steps:
18-
- uses: actions/checkout@v4
19-
with:
20-
submodules: recursive
21-
22-
- name: Setup .NET
23-
uses: actions/setup-dotnet@v4
24-
with:
25-
dotnet-version: 9.0.x
26-
27-
- name: Restore .NET dependencies
28-
working-directory: ./src
29-
run: dotnet restore
30-
31-
- name: Build
32-
working-directory: ./src
33-
run: dotnet build --no-restore
34-
35-
- name: Upload Build Artifact
36-
uses: actions/upload-artifact@v4
37-
with:
38-
name: buildArtifact
39-
path: ./src
40-
retention-days: 7
41-
4217
tests:
4318
name: Run Unit Tests
44-
runs-on: ubuntu-latest
4519
needs: build
46-
47-
steps:
48-
- name: Setup .NET
49-
uses: actions/setup-dotnet@v4
50-
with:
51-
dotnet-version: 9.0.x
52-
53-
- uses: actions/download-artifact@v4
54-
with:
55-
name: buildArtifact
56-
path: ./src
57-
58-
- name: Test
59-
working-directory: ./src/NodeDev.Tests
60-
run: dotnet test --no-build --verbosity normal
20+
uses: ./.github/workflows/workflow-tests.yml
6121

6222
e2e-tests:
6323
name: Run End To End Tests
64-
runs-on: ubuntu-latest
6524
needs: build
25+
uses: ./.github/workflows/workflow-e2e-tests.yml
6626

67-
steps:
68-
- name: Setup .NET
69-
uses: actions/setup-dotnet@v4
70-
with:
71-
dotnet-version: 9.0.x
72-
73-
- uses: actions/download-artifact@master
74-
with:
75-
name: buildArtifact
76-
path: ./src
77-
78-
- name: Build Necessary for Playwright
79-
working-directory: ./src/NodeDev.EndToEndTests
80-
run: dotnet build
81-
82-
- name: Allow run
83-
run: chmod -R +x ./src/NodeDev.Blazor.Server/bin
84-
85-
- name: Ensure browsers are installed
86-
run: pwsh ./src/NodeDev.EndToEndTests/bin/Debug/net9.0/playwright.ps1 install --with-deps
87-
88-
- name: Test
89-
env:
90-
HEADLESS: true
91-
working-directory: ./src/NodeDev.EndToEndTests
92-
run: dotnet test --no-build --verbosity normal
93-
94-
- name: Upload std Artifact
95-
if: failure()
96-
uses: actions/upload-artifact@v4
97-
with:
98-
name: logServer
99-
path: ./src/NodeDev.Blazor.Server/logs
100-
retention-days: 7

‎.github/workflows/release.yml

+7-82
Original file line numberDiff line numberDiff line change
@@ -12,98 +12,23 @@ permissions:
1212

1313
jobs:
1414
build:
15-
name: Build the entire solution
16-
runs-on: windows-latest
17-
18-
steps:
19-
- uses: actions/checkout@v4
20-
with:
21-
submodules: recursive
15+
name: .Build the entire solution
16+
uses: ./.github/workflows/workflow-build.yml
2217

23-
- name: Setup .NET
24-
uses: actions/setup-dotnet@v4
25-
with:
26-
dotnet-version: 9.0.x
27-
28-
- name: Restore .NET dependencies
29-
working-directory: ./src
30-
run: dotnet restore
31-
32-
- name: Build
33-
working-directory: ./src
34-
run: dotnet build --no-restore
35-
36-
- name: Upload Build Artifact
37-
uses: actions/upload-artifact@v4
38-
with:
39-
name: buildArtifact
40-
path: ./src
41-
retention-days: 7
42-
4318
tests:
44-
name: Run Unit Tests
45-
runs-on: ubuntu-latest
19+
name: .Run Unit Tests
4620
needs: build
47-
48-
steps:
49-
- name: Setup .NET
50-
uses: actions/setup-dotnet@v4
51-
with:
52-
dotnet-version: 9.0.x
53-
54-
- uses: actions/download-artifact@v4
55-
with:
56-
name: buildArtifact
57-
path: ./src
58-
59-
- name: Test
60-
working-directory: ./src/NodeDev.Tests
61-
run: dotnet test --no-build --verbosity normal
21+
uses: ./.github/workflows/workflow-tests.yml
6222

6323
e2e-tests:
64-
name: Run End To End Tests
65-
runs-on: ubuntu-latest
24+
name: .Run End To End Tests
6625
needs: build
67-
68-
steps:
69-
- name: Setup .NET
70-
uses: actions/setup-dotnet@v4
71-
with:
72-
dotnet-version: 9.0.x
73-
74-
- uses: actions/download-artifact@master
75-
with:
76-
name: buildArtifact
77-
path: ./src
78-
79-
- name: Build Necessary for Playwright
80-
working-directory: ./src/NodeDev.EndToEndTests
81-
run: dotnet build
82-
83-
- name: Allow run
84-
run: chmod -R +x ./src/NodeDev.Blazor.Server/bin
85-
86-
- name: Ensure browsers are installed
87-
run: pwsh ./src/NodeDev.EndToEndTests/bin/Debug/net9.0/playwright.ps1 install --with-deps
88-
89-
- name: Test
90-
env:
91-
HEADLESS: true
92-
working-directory: ./src/NodeDev.EndToEndTests
93-
run: dotnet test --no-build --verbosity normal
94-
95-
- name: Upload std Artifact
96-
if: failure()
97-
uses: actions/upload-artifact@v4
98-
with:
99-
name: logServer
100-
path: ./src/NodeDev.Blazor.Server/logs
101-
retention-days: 7
26+
uses: ./.github/workflows/workflow-e2e-tests.yml
10227

10328
publish:
10429
name: Publish and package
10530
runs-on: windows-latest
106-
needs: [build, tests, e2e-tests]
31+
needs: [build,tests,e2e-tests]
10732

10833
steps:
10934
- uses: actions/checkout@v4

‎.github/workflows/workflow-build.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: .Build the entire solution
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
runs-on: windows-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
submodules: recursive
14+
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v4
17+
with:
18+
dotnet-version: 9.0.x
19+
20+
- name: Restore .NET dependencies
21+
working-directory: ./src
22+
run: dotnet restore
23+
24+
- name: Build
25+
working-directory: ./src
26+
run: dotnet build --no-restore
27+
28+
- name: Upload Build Artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: buildArtifact
32+
path: ./src
33+
retention-days: 7
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: .Run End To End Tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
e2e-tests:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Setup .NET
12+
uses: actions/setup-dotnet@v4
13+
with:
14+
dotnet-version: 9.0.x
15+
16+
- uses: actions/download-artifact@master
17+
with:
18+
name: buildArtifact
19+
path: ./src
20+
21+
- name: Build Necessary for Playwright
22+
working-directory: ./src/NodeDev.EndToEndTests
23+
run: dotnet build
24+
25+
- name: Allow run
26+
run: chmod -R +x ./src/NodeDev.Blazor.Server/bin
27+
28+
- name: Ensure browsers are installed
29+
run: pwsh ./src/NodeDev.EndToEndTests/bin/Debug/net9.0/playwright.ps1 install --with-deps
30+
31+
- name: Test
32+
env:
33+
HEADLESS: true
34+
working-directory: ./src/NodeDev.EndToEndTests
35+
run: dotnet test --no-build --verbosity normal
36+
37+
- name: Upload std Artifact
38+
if: failure()
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: logServer
42+
path: ./src/NodeDev.Blazor.Server/logs
43+
retention-days: 7

‎.github/workflows/workflow-tests.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: .Run Unit Tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
tests:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Setup .NET
12+
uses: actions/setup-dotnet@v4
13+
with:
14+
dotnet-version: 9.0.x
15+
16+
- uses: actions/download-artifact@v4
17+
with:
18+
name: buildArtifact
19+
path: ./src
20+
21+
- name: Test
22+
working-directory: ./src/NodeDev.Tests
23+
run: dotnet test --no-build --verbosity normal

‎.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
/src/NodeDev.Blazor.MAUI/bin/Debug/net9.0-windows10.0.19041.0/win10-x64
3232
/src/NodeDev.Blazor.MAUI/obj
3333
/src/NodeDev.Blazor.MAUI/bin/Release/net9.0-windows10.0.19041.0/win-x64
34-
/src/NodeDev.Blazor.Server/AppOptions.json
34+
/src/NodeDev.Blazor.Server/AppOptions.json

0 commit comments

Comments
 (0)
Please sign in to comment.