Skip to content

Commit bdbf09c

Browse files
committed
Initial commit
1 parent 61cefc6 commit bdbf09c

46 files changed

Lines changed: 5125 additions & 1 deletion

File tree

Some content is hidden

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

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.github/workflows/CI.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Continuous Integration workflow.
2+
#
3+
# This workflow runs on every push and pull request to main branch:
4+
# 1. Builds the solution using the reusable build workflow
5+
# 2. Runs all tests using the pre-built artifacts
6+
#
7+
# Tests run against all target frameworks (.NET 8, 9, 10) to ensure
8+
# compatibility across supported versions.
9+
10+
name: CI
11+
12+
on:
13+
push:
14+
branches: [ main ]
15+
pull_request:
16+
branches: [ main ]
17+
18+
# Cancel in-progress runs when a new run is triggered for the same branch/PR.
19+
# This prevents resource conflicts and saves CI minutes.
20+
# Reference: https://docs.github.com/en/actions/using-jobs/using-concurrency
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
# Restrict default permissions for security
26+
permissions:
27+
contents: read
28+
29+
jobs:
30+
# Build the solution using the reusable workflow
31+
build:
32+
uses: ./.github/workflows/build.yml
33+
with:
34+
configuration: Debug
35+
upload_artifacts: true
36+
37+
# Run tests using the pre-built artifacts
38+
test:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
timeout-minutes: 30
42+
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v4
46+
47+
- name: Setup .NET
48+
uses: actions/setup-dotnet@v4
49+
with:
50+
dotnet-version: |
51+
8.0.x
52+
9.0.x
53+
10.0.x
54+
55+
- name: Download build artifacts
56+
uses: actions/download-artifact@v4
57+
with:
58+
name: build-output-Debug
59+
60+
- name: Restore dependencies
61+
# Restore is required even with --no-build so the test runner can locate packages
62+
run: dotnet restore EfCore.StorageEstimator.slnx
63+
64+
- name: Run tests
65+
run: dotnet test EfCore.StorageEstimator.slnx --no-build --verbosity normal --logger trx --results-directory ./test-results
66+
67+
- name: Upload test results
68+
# Upload test results even if tests fail for debugging purposes
69+
uses: actions/upload-artifact@v4
70+
if: always()
71+
with:
72+
name: test-results
73+
path: ./test-results
74+
retention-days: 7

.github/workflows/build.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Reusable workflow for building the solution.
2+
#
3+
# This workflow is designed to be called by other workflows to avoid
4+
# redundant compilation. It builds the solution and uploads the build
5+
# artifacts for downstream jobs to consume.
6+
#
7+
# Usage in other workflows:
8+
# jobs:
9+
# build:
10+
# uses: ./.github/workflows/build.yml
11+
# with:
12+
# configuration: Release
13+
#
14+
# dependent-job:
15+
# needs: build
16+
# steps:
17+
# - uses: actions/download-artifact@v4
18+
# with:
19+
# name: build-output-Release
20+
21+
name: Build
22+
23+
on:
24+
# Allow this workflow to be called by other workflows
25+
workflow_call:
26+
inputs:
27+
configuration:
28+
description: 'Build configuration (Debug or Release)'
29+
required: false
30+
default: 'Debug'
31+
type: string
32+
upload_artifacts:
33+
description: 'Whether to upload build artifacts'
34+
required: false
35+
default: true
36+
type: boolean
37+
38+
# Also allow standalone execution for testing
39+
workflow_dispatch:
40+
inputs:
41+
configuration:
42+
description: 'Build configuration'
43+
required: false
44+
default: 'Debug'
45+
type: choice
46+
options:
47+
- Debug
48+
- Release
49+
50+
# Restrict default permissions for security
51+
permissions:
52+
contents: read
53+
54+
jobs:
55+
build:
56+
runs-on: ubuntu-latest
57+
timeout-minutes: 15
58+
59+
steps:
60+
- name: Checkout repository
61+
uses: actions/checkout@v4
62+
with:
63+
fetch-depth: 0 # Full history for version calculation
64+
65+
- name: Setup .NET
66+
uses: actions/setup-dotnet@v4
67+
with:
68+
dotnet-version: |
69+
8.0.x
70+
9.0.x
71+
10.0.x
72+
73+
- name: Restore dependencies
74+
run: dotnet restore EfCore.StorageEstimator.slnx
75+
76+
- name: Build solution
77+
# Build the entire solution with the specified configuration
78+
run: dotnet build EfCore.StorageEstimator.slnx --configuration ${{ inputs.configuration }} --no-restore
79+
80+
- name: Upload build artifacts
81+
# Upload the build output for downstream jobs to consume
82+
# This avoids the need to rebuild in dependent workflows
83+
if: ${{ inputs.upload_artifacts }}
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: build-output-${{ inputs.configuration }}
87+
path: |
88+
src/**/bin/${{ inputs.configuration }}
89+
src/**/obj/${{ inputs.configuration }}
90+
tests/**/bin/${{ inputs.configuration }}
91+
tests/**/obj/${{ inputs.configuration }}
92+
samples/**/bin/${{ inputs.configuration }}
93+
samples/**/obj/${{ inputs.configuration }}
94+
retention-days: 1

0 commit comments

Comments
 (0)