Skip to content

Commit a5b5a8c

Browse files
authored
Release v0.5.3
* Adds glogal .editorconfig * Add Full, Core and Auth Solution * Add matrix test for CI * Add Category "Unit" for unit test projects * Add Category "Integration" for integration test projects * Add .editorconfig in projects to prevent constructor code smell in test code * Separate Test Results in projects (auth and core) * Move tests to /tests folder * Move Migrations to Infra.Data * Change the whole project folder structure * Separate /api projects in contexts * Fix projects references * Fix test projects references * Remove Core.Infra.Migrations project
1 parent 1d735a7 commit a5b5a8c

365 files changed

Lines changed: 1145 additions & 268 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Cache Sonar Package & Sonar Scanner
2+
description: This is just to make
3+
4+
inputs:
5+
os:
6+
description: 'operational system'
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Cache SonarCloud packages
13+
uses: actions/cache@v1
14+
with:
15+
path: ~\sonar\cache
16+
key: ${{ inputs.os }}-sonar
17+
restore-keys: ${{ inputs.os }}-sonar
18+
19+
- name: Cache SonarCloud scanner
20+
id: cache-sonar-scanner
21+
uses: actions/cache@v1
22+
with:
23+
path: .\.sonar\scanner
24+
key: ${{ inputs.os }}-sonar-scanner
25+
restore-keys: ${{ inputs.os }}-sonar-scanner
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Run Tests
2+
description: This project run project that has an assemly with an specified Category
3+
4+
inputs:
5+
project-dir:
6+
description: 'project directory'
7+
required: true
8+
category:
9+
description: 'Type of the test (Unit or Integration)'
10+
default: Unit
11+
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Run Tests
16+
shell: bash
17+
continue-on-error: true
18+
run: dotnet test ${{ inputs.project-dir }}
19+
--filter TestCategory=${{ inputs.category }}
20+
--logger:"trx;logfilename=Results.xml"
21+
--configuration release
22+

.github/workflows/api_releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020

2121
- name: Get version
2222
run: echo "value=${BRANCH##*/}" >> $GITHUB_OUTPUT
23+
id: version
2324
env:
2425
BRANCH: ${{ github.event.pull_request.base.ref }}
25-
id: version
2626

2727
- name: Create tag
2828
uses: actions/github-script@v5

.github/workflows/branch_main_ci.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,18 @@ permissions:
2020

2121
jobs:
2222
tests:
23-
uses: ./.github/workflows/tests_workflow.yml
23+
name: Tests
24+
uses: ./.github/workflows/matrix_test_result.yml
25+
secrets: inherit
2426
with:
2527
dir: ./src/api/
26-
secrets: inherit
28+
dotnet-version: 6.0.x
29+
30+
code_analysis:
31+
name: Code Analysis
32+
needs: tests
33+
uses: ./.github/workflows/coverage_report.yml
34+
secrets: inherit
35+
with:
36+
dir: ./src/api/
37+
dotnet-version: 6.0.x

.github/workflows/branch_release_ci.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,18 @@ permissions:
1414

1515
jobs:
1616
tests:
17-
uses: ./.github/workflows/tests_workflow.yml
17+
name: Tests
18+
uses: ./.github/workflows/matrix_test_result.yml
19+
secrets: inherit
1820
with:
1921
dir: ./src/api/
20-
secrets: inherit
22+
dotnet-version: 6.0.x
23+
24+
code_analysis:
25+
name: Code Analysis
26+
needs: tests
27+
uses: ./.github/workflows/coverage_report.yml
28+
secrets: inherit
29+
with:
30+
dir: ./src/api/
31+
dotnet-version: 6.0.x
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Api Test Result
2+
on:
3+
workflow_call:
4+
inputs:
5+
dir:
6+
type: string
7+
required: true
8+
dotnet-version:
9+
type: string
10+
default: 6.0.x
11+
12+
permissions:
13+
checks: write
14+
pull-requests: write
15+
16+
jobs:
17+
test_results:
18+
name: Code Tests
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
matrix:
23+
project:
24+
- core
25+
- auth
26+
env:
27+
project-dir: ${{ inputs.dir }}/${{ matrix.project }}
28+
29+
services:
30+
sql-database:
31+
image: mcr.microsoft.com/mssql/server:2019-latest
32+
env:
33+
SA_PASSWORD: "P@ssw0rd!"
34+
ACCEPT_EULA: "Y"
35+
ports:
36+
- 1450:1433
37+
38+
steps:
39+
- uses: actions/checkout@v2
40+
41+
- name: Setup Project
42+
uses: ./.github/actions/build-dotnet-project
43+
with:
44+
project-dir: ${{ inputs.dir }}
45+
dotnet-version: 6.0.x
46+
47+
- name: Run Unit Tests
48+
uses: ./.github/actions/run-tests
49+
with:
50+
project-dir: ${{ inputs.dir }}
51+
category: Unit
52+
53+
- name: Run Integration Tests
54+
uses: ./.github/actions/run-tests
55+
with:
56+
project-dir: ${{ inputs.dir }}
57+
category: Integration
58+
59+
- name: Publish Test Results
60+
uses: EnricoMi/publish-unit-test-result-action/composite@v2
61+
with:
62+
github_token: ${{ secrets.GITHUB_TOKEN }}
63+
check_name: ${{ matrix.project }} project test results
64+
action_fail: true
65+
files: "./tests/${{ matrix.project }}/**/TestResults/Results.xml"

.github/workflows/test_result.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,17 @@ jobs:
4040
project-dir: ${{ inputs.dir }}
4141
dotnet-version: ${{ inputs.dotnet-version }}
4242

43-
- name: Run Tests
44-
continue-on-error: true
45-
run: dotnet test
46-
--logger:"trx;logfilename=Results.xml"
47-
--configuration release
43+
- name: Run Unit Tests
44+
uses: ./.github/actions/run-tests
45+
with:
46+
project-dir: ${{ inputs.dir }}
47+
category: Unit
48+
49+
- name: Run Integration Tests
50+
uses: ./.github/actions/run-tests
51+
with:
52+
project-dir: ${{ inputs.dir }}
53+
category: Integration
4854

4955
- name: Publish Test Results
5056
uses: EnricoMi/publish-unit-test-result-action/composite@v2

0 commit comments

Comments
 (0)