-
Notifications
You must be signed in to change notification settings - Fork 11
Add dotnet-test.yml to automate unit tests with GitHub Actions #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
afshinalizadeh
merged 15 commits into
develop
from
feature/afshin/add-run-test-github-action
Oct 31, 2025
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
dbbc27f
Add dotnet-test.yml to automate unit tests with GitHub Actions
afshinalizadeh 6950e4a
Remove bit ResxTranslator step from dotnet-test.yml
afshinalizadeh 835030f
Fix path syntax in dotnet-test.yml
afshinalizadeh 91c270f
Add install wasm-tools in dotnet-test.yml.
afshinalizadeh 51cbd36
Merge branch 'feature/afshin/add-run-test-github-action' of https://g…
afshinalizadeh da70e70
Add CrystaLearn.TestOnly.sln
afshinalizadeh 1caf53a
Add Some Environment Variable to dotnet-test.yml
afshinalizadeh 0533b46
Add GitHubAccessToken to environment variable
afshinalizadeh 43c41b5
Install playwright in dotnet-test.yml
afshinalizadeh 0b27121
Add Playwright CLI to tool manifest
afshinalizadeh f9ec5b7
Fix install Playwright
afshinalizadeh 824f20e
Fix install Playwright
afshinalizadeh c741972
Remove TestMethod attribute from SignIn_Should_WorkAsExpected
afshinalizadeh 1abf636
Update .github/workflows/dotnet-test.yml
afshinalizadeh 592d484
Update .github/workflows/dotnet-test.yml
afshinalizadeh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| name: .NET Test | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ develop,main ] | ||
| pull_request: | ||
| branches: [ develop,main ] | ||
afshinalizadeh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| jobs: | ||
| build-and-test: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| AZUREDEVOPS__PERSONALACCESSTOKEN: ${{ secrets.AZUREDEVOPS__PERSONALACCESSTOKEN }} | ||
| CONNECTIONSTRINGS__POSTGRESCONNECTIONSTRING: ${{ secrets.CONNECTIONSTRINGS__POSTGRESCONNECTIONSTRING }} | ||
| GitHub__GitHubAccessToken : ${{ secrets.GITHUBACCESSTOKEN }} | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| global-json-file: global.json | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 23 | ||
|
|
||
| - name: Install wasm | ||
| run: cd src && dotnet workload install wasm-tools | ||
|
|
||
| - name: Restore dependencies | ||
| run: dotnet restore CrystaLearn.TestOnly.sln | ||
|
|
||
| - name: Build | ||
| run: dotnet build CrystaLearn.TestOnly.sln --no-restore | ||
|
|
||
| - name: Install Playwright Browsers | ||
| run: | | ||
| cd src/Test/CrystaLearn.Test | ||
| dotnet tool install Microsoft.Playwright.CLI | ||
afshinalizadeh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| dotnet playwright install | ||
|
|
||
| - name: Run tests | ||
| run: dotnet test CrystaLearn.TestOnly.sln --no-build --verbosity normal | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 17 | ||
| VisualStudioVersion = 17.0.31611.283 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CrystaLearn.Server.Web", "src\Server\CrystaLearn.Server.Web\CrystaLearn.Server.Web.csproj", "{8CC3E410-B716-4F4D-89C7-3392CA624439}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrystaLearn.Server.Shared", "src\Server\CrystaLearn.Server.Shared\CrystaLearn.Server.Shared.csproj", "{AA97E5DE-1021-2739-ED90-9EDEEAEB5CA2}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".SolutionItems", ".SolutionItems", "{5CF43F76-BB71-4B5B-B4DF-1C753E042A8F}" | ||
| ProjectSection(SolutionItems) = preProject | ||
| .editorconfig = .editorconfig | ||
| .gitignore = .gitignore | ||
| .vsconfig = .vsconfig | ||
| Bit.ResxTranslator.json = Bit.ResxTranslator.json | ||
| Clean.bat = Clean.bat | ||
| src\Directory.Build.props = src\Directory.Build.props | ||
| src\Directory.Packages.props = src\Directory.Packages.props | ||
| Dockerfile = Dockerfile | ||
| global.json = global.json | ||
| .vscode\mcp.json = .vscode\mcp.json | ||
| README.md = README.md | ||
| settings.VisualStudio.json = settings.VisualStudio.json | ||
| EndProjectSection | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{248D8229-BABD-4F0A-A9C6-0417B464507B}" | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CrystaLearn.Client.Core", "src\Client\CrystaLearn.Client.Core\CrystaLearn.Client.Core.csproj", "{FC60C68D-8E8D-494B-8D60-0C8D83A472E7}" | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CrystaLearn.Client.Web", "src\Client\CrystaLearn.Client.Web\CrystaLearn.Client.Web.csproj", "{13D6A40B-8B8B-41F0-AB62-3F5F1CB58A1B}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{3E577755-186F-4E63-8153-B8DE890015C9}" | ||
| ProjectSection(SolutionItems) = preProject | ||
| .github\copilot-instructions.md = .github\copilot-instructions.md | ||
| EndProjectSection | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "prompts", "prompts", "{4A5D6E7F-8B9C-1A2B-3C4D-5E6F7A8B9C0D}" | ||
| ProjectSection(SolutionItems) = preProject | ||
| .github\prompts\resx.prompt.md = .github\prompts\resx.prompt.md | ||
| .github\prompts\scaffold.prompt.md = .github\prompts\scaffold.prompt.md | ||
| EndProjectSection | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{2347E3B2-FDDE-427E-A0AE-E4DCD47C2989}" | ||
| ProjectSection(SolutionItems) = preProject | ||
| .github\workflows\cd-develop.yml = .github\workflows\cd-develop.yml | ||
| .github\workflows\cd-production.yml = .github\workflows\cd-production.yml | ||
| .github\workflows\cd-template.yml = .github\workflows\cd-template.yml | ||
| .github\workflows\ci.yml = .github\workflows\ci.yml | ||
| EndProjectSection | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CrystaLearn.Client.Windows", "src\Client\CrystaLearn.Client.Windows\CrystaLearn.Client.Windows.csproj", "{E3CB3C34-F5DE-4A96-B552-7D52BCAD1E1F}" | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CrystaLearn.Server.Api", "src\Server\CrystaLearn.Server.Api\CrystaLearn.Server.Api.csproj", "{3D93B170-BDCD-4890-92B3-F5ABE48F3D3A}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{723683EA-193C-45FD-A64D-7830A2867E4F}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{EAB56593-7B10-4CC4-A3B8-E62ACDD1E6DD}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{B38FF18E-11BC-4AF6-8FA3-648B3952DCAF}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Console", "Console", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{C36CFF28-CAFE-4DD4-8819-2B72613691A8}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrystaLearn.Core", "src\Core\CrystaLearn.Core\CrystaLearn.Core.csproj", "{50DBE157-AA16-7B4F-BC02-CD74DAE45AA2}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrystaLearn.Core.Test", "src\Core\CrystaLearn.Core.Test\CrystaLearn.Core.Test.csproj", "{DFF2B3BF-3F9B-4016-944E-885962FF1AE6}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".azure", ".azure", "{6F2F419F-1348-4115-9082-46DFDD9D5347}" | ||
| ProjectSection(SolutionItems) = preProject | ||
| .azure\ci.yml = .azure\ci.yml | ||
| EndProjectSection | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrystaLearn.Shared", "src\Shared\CrystaLearn.Shared\CrystaLearn.Shared.csproj", "{A354538E-3FE9-E7E1-5549-BDE3CC8B4E57}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrystaLearn.Console", "src\Console\CrystaLearn.Console\CrystaLearn.Console.csproj", "{0C7A0635-96D1-CC2E-6DE7-55FCEB6645BF}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrystaLearn.Test", "src\Test\CrystaLearn.Test\CrystaLearn.Test.csproj", "{56CF1939-AE5C-7203-3425-919867BB5F04}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {8CC3E410-B716-4F4D-89C7-3392CA624439}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {8CC3E410-B716-4F4D-89C7-3392CA624439}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {8CC3E410-B716-4F4D-89C7-3392CA624439}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {8CC3E410-B716-4F4D-89C7-3392CA624439}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {AA97E5DE-1021-2739-ED90-9EDEEAEB5CA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {AA97E5DE-1021-2739-ED90-9EDEEAEB5CA2}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {AA97E5DE-1021-2739-ED90-9EDEEAEB5CA2}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {AA97E5DE-1021-2739-ED90-9EDEEAEB5CA2}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {FC60C68D-8E8D-494B-8D60-0C8D83A472E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {FC60C68D-8E8D-494B-8D60-0C8D83A472E7}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {FC60C68D-8E8D-494B-8D60-0C8D83A472E7}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {FC60C68D-8E8D-494B-8D60-0C8D83A472E7}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {13D6A40B-8B8B-41F0-AB62-3F5F1CB58A1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {13D6A40B-8B8B-41F0-AB62-3F5F1CB58A1B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {13D6A40B-8B8B-41F0-AB62-3F5F1CB58A1B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {13D6A40B-8B8B-41F0-AB62-3F5F1CB58A1B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {E3CB3C34-F5DE-4A96-B552-7D52BCAD1E1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {E3CB3C34-F5DE-4A96-B552-7D52BCAD1E1F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {E3CB3C34-F5DE-4A96-B552-7D52BCAD1E1F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {E3CB3C34-F5DE-4A96-B552-7D52BCAD1E1F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {3D93B170-BDCD-4890-92B3-F5ABE48F3D3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {3D93B170-BDCD-4890-92B3-F5ABE48F3D3A}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {3D93B170-BDCD-4890-92B3-F5ABE48F3D3A}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {3D93B170-BDCD-4890-92B3-F5ABE48F3D3A}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {50DBE157-AA16-7B4F-BC02-CD74DAE45AA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {50DBE157-AA16-7B4F-BC02-CD74DAE45AA2}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {50DBE157-AA16-7B4F-BC02-CD74DAE45AA2}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {50DBE157-AA16-7B4F-BC02-CD74DAE45AA2}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {DFF2B3BF-3F9B-4016-944E-885962FF1AE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {DFF2B3BF-3F9B-4016-944E-885962FF1AE6}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {DFF2B3BF-3F9B-4016-944E-885962FF1AE6}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {DFF2B3BF-3F9B-4016-944E-885962FF1AE6}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {A354538E-3FE9-E7E1-5549-BDE3CC8B4E57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {A354538E-3FE9-E7E1-5549-BDE3CC8B4E57}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {A354538E-3FE9-E7E1-5549-BDE3CC8B4E57}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {A354538E-3FE9-E7E1-5549-BDE3CC8B4E57}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {0C7A0635-96D1-CC2E-6DE7-55FCEB6645BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {0C7A0635-96D1-CC2E-6DE7-55FCEB6645BF}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {0C7A0635-96D1-CC2E-6DE7-55FCEB6645BF}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {0C7A0635-96D1-CC2E-6DE7-55FCEB6645BF}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {56CF1939-AE5C-7203-3425-919867BB5F04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {56CF1939-AE5C-7203-3425-919867BB5F04}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {56CF1939-AE5C-7203-3425-919867BB5F04}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {56CF1939-AE5C-7203-3425-919867BB5F04}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(NestedProjects) = preSolution | ||
| {8CC3E410-B716-4F4D-89C7-3392CA624439} = {723683EA-193C-45FD-A64D-7830A2867E4F} | ||
| {AA97E5DE-1021-2739-ED90-9EDEEAEB5CA2} = {723683EA-193C-45FD-A64D-7830A2867E4F} | ||
| {FC60C68D-8E8D-494B-8D60-0C8D83A472E7} = {248D8229-BABD-4F0A-A9C6-0417B464507B} | ||
| {13D6A40B-8B8B-41F0-AB62-3F5F1CB58A1B} = {248D8229-BABD-4F0A-A9C6-0417B464507B} | ||
| {3E577755-186F-4E63-8153-B8DE890015C9} = {5CF43F76-BB71-4B5B-B4DF-1C753E042A8F} | ||
| {4A5D6E7F-8B9C-1A2B-3C4D-5E6F7A8B9C0D} = {3E577755-186F-4E63-8153-B8DE890015C9} | ||
| {2347E3B2-FDDE-427E-A0AE-E4DCD47C2989} = {3E577755-186F-4E63-8153-B8DE890015C9} | ||
| {E3CB3C34-F5DE-4A96-B552-7D52BCAD1E1F} = {248D8229-BABD-4F0A-A9C6-0417B464507B} | ||
| {3D93B170-BDCD-4890-92B3-F5ABE48F3D3A} = {723683EA-193C-45FD-A64D-7830A2867E4F} | ||
| {50DBE157-AA16-7B4F-BC02-CD74DAE45AA2} = {C36CFF28-CAFE-4DD4-8819-2B72613691A8} | ||
| {DFF2B3BF-3F9B-4016-944E-885962FF1AE6} = {C36CFF28-CAFE-4DD4-8819-2B72613691A8} | ||
| {6F2F419F-1348-4115-9082-46DFDD9D5347} = {5CF43F76-BB71-4B5B-B4DF-1C753E042A8F} | ||
| {A354538E-3FE9-E7E1-5549-BDE3CC8B4E57} = {EAB56593-7B10-4CC4-A3B8-E62ACDD1E6DD} | ||
| {0C7A0635-96D1-CC2E-6DE7-55FCEB6645BF} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} | ||
| {56CF1939-AE5C-7203-3425-919867BB5F04} = {B38FF18E-11BC-4AF6-8FA3-648B3952DCAF} | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {E82D1976-7A33-41F5-8B81-2F6B4034CFE3} | ||
| EndGlobalSection | ||
| EndGlobal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "version": 1, | ||
| "isRoot": true, | ||
| "tools": { | ||
| "microsoft.playwright.cli": { | ||
| "version": "1.2.3", | ||
| "commands": [ | ||
| "playwright" | ||
| ], | ||
| "rollForward": false | ||
afshinalizadeh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.