Skip to content

Commit 435247c

Browse files
committed
chore: update workflows and project files
Refactor project configuration and workflows to improve dependency management and build processes. - Change Dependabot update schedule from daily to weekly for NuGet packages. - Update CodeQL analysis workflow to streamline pull request handling. - Modify dependabot-reviewer workflow for better integration with centralized workflows. - Adjust document site publish workflow for consistency in branch naming. - Expand target frameworks in Data.Modeler project file to include net9.0 and net10.0. - Update versioning in Data.Modeler project file to 5.0.130. - Change target framework in Data.Modeler.Tests project file to net10.0. - Add new .NET Publish workflow for building and deploying the project. - Introduce .NET Test Pull Requests workflow for automated testing on pull requests.
1 parent 035e989 commit 435247c

8 files changed

Lines changed: 361 additions & 19 deletions

File tree

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ updates:
1919
- package-ecosystem: "nuget" # See documentation for possible values
2020
directory: "/test/Data.Modeler.Tests/" # Location of package manifests
2121
schedule:
22-
interval: "daily"
22+
interval: "weekly"
2323
commit-message:
2424
prefix: "chore"
2525
groups:
@@ -30,7 +30,7 @@ updates:
3030
- package-ecosystem: "nuget" # See documentation for possible values
3131
directory: "/Data.Modeler.Example/" # Location of package manifests
3232
schedule:
33-
interval: "daily"
33+
interval: "weekly"
3434
commit-message:
3535
prefix: "chore"
3636
groups:
@@ -41,7 +41,7 @@ updates:
4141
- package-ecosystem: "github-actions"
4242
directory: "/"
4343
schedule:
44-
interval: "daily"
44+
interval: "weekly"
4545
commit-message:
4646
prefix: "chore"
4747
groups:

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@
1212
name: "CodeQL"
1313

1414
on:
15-
push:
16-
branches: [ "master" ]
1715
pull_request:
18-
branches: [ "master" ]
16+
branches: ["master"]
1917
schedule:
20-
- cron: '37 18 * * 3'
18+
- cron: "37 18 * * 3"
2119

2220
permissions:
2321
actions: read

.github/workflows/dependabot-reviewer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ jobs:
1111
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
1212
uses: JaCraig/Centralized-Workflows/.github/workflows/dependabot-reviewer.yml@main
1313
secrets:
14-
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
14+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

.github/workflows/docsfx.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Document Site Publish
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: ["master"]
66

77
permissions:
88
contents: write
99

1010
jobs:
1111
publish-docs:
12-
uses: JaCraig/Centralized-Workflows/.github/workflows/docsfx.yml@main
12+
uses: JaCraig/Centralized-Workflows/.github/workflows/docsfx.yml@main
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: .NET Publish
5+
6+
on:
7+
push:
8+
branches: ["master", "main"]
9+
workflow_dispatch:
10+
inputs:
11+
dotnet-version:
12+
description: ".NET SDK version"
13+
required: false
14+
default: "10.0.x"
15+
solution:
16+
description: "Solution or project path to build/test"
17+
required: false
18+
default: "Data.Modeler.sln"
19+
test-filter:
20+
description: "Optional dotnet test filter"
21+
required: false
22+
default: ""
23+
coveralls-upload:
24+
description: "Optional lcov path for Coveralls"
25+
required: false
26+
default: ""
27+
user-email:
28+
description: "Git identity email used for release commit"
29+
required: false
30+
default: "JaCraig@users.noreply.github.com"
31+
user:
32+
description: "Git identity name used for release commit"
33+
required: false
34+
default: "JaCraig"
35+
36+
concurrency:
37+
group: ${{ github.workflow }}-${{ github.ref }}
38+
cancel-in-progress: false
39+
40+
jobs:
41+
build:
42+
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
43+
timeout-minutes: 45
44+
permissions:
45+
contents: write
46+
env:
47+
BUILD_CONFIG: "Release"
48+
SOLUTION_FILE: "${{ inputs.solution || 'Data.Modeler.sln' }}"
49+
TEST_FILTER: "${{ inputs.test-filter || '' }}"
50+
COVERALLS_UPLOAD: "${{ inputs.coveralls-upload || '' }}"
51+
GIT_USER_EMAIL: "${{ inputs.user-email || 'JaCraig@users.noreply.github.com' }}"
52+
GIT_USER_NAME: "${{ inputs.user || 'JaCraig' }}"
53+
54+
SQL_HOST: "127.0.0.1"
55+
SQL_PORT: "1433"
56+
SQL_SERVER: "127.0.0.1,1433"
57+
SQL_PASSWORD: "${{ secrets.SQL_PASSWORD }}"
58+
59+
runs-on: ubuntu-latest
60+
services:
61+
sqlserver:
62+
image: mcr.microsoft.com/mssql/server:2022-latest
63+
env:
64+
ACCEPT_EULA: "Y"
65+
MSSQL_PID: "Developer"
66+
SA_PASSWORD: "${{ secrets.SQL_PASSWORD }}"
67+
ports:
68+
- 1433:1433
69+
70+
strategy:
71+
matrix:
72+
dotnet-version: ["${{ inputs.dotnet-version || '10.0.x' }}"]
73+
74+
steps:
75+
- uses: actions/checkout@v6
76+
with:
77+
fetch-depth: 0
78+
persist-credentials: false
79+
80+
- name: Setup .NET SDK ${{ matrix.dotnet-version }}
81+
uses: actions/setup-dotnet@v5.2.0
82+
with:
83+
dotnet-version: ${{ matrix.dotnet-version }}
84+
85+
- name: Wait for SQL Server
86+
shell: bash
87+
run: |
88+
for i in {1..60}; do
89+
if timeout 1 bash -c "</dev/tcp/$SQL_HOST/$SQL_PORT" 2>/dev/null; then
90+
echo "SQL Server port is reachable."
91+
exit 0
92+
fi
93+
echo "Waiting for SQL Server... attempt $i"
94+
sleep 2
95+
done
96+
echo "SQL Server did not become reachable in time."
97+
exit 1
98+
99+
- name: Create test databases
100+
shell: bash
101+
run: |
102+
docker exec "${{ job.services.sqlserver.id }}" /opt/mssql-tools18/bin/sqlcmd \
103+
-S localhost \
104+
-U sa \
105+
-P "$SQL_PASSWORD" \
106+
-C \
107+
-Q "IF DB_ID(N'TestDatabase') IS NULL CREATE DATABASE [TestDatabase]; IF DB_ID(N'TestDatabase2') IS NULL CREATE DATABASE [TestDatabase2]; IF DB_ID(N'MockDatabase') IS NULL CREATE DATABASE [MockDatabase]; IF DB_ID(N'MockDatabaseForMockMapping') IS NULL CREATE DATABASE [MockDatabaseForMockMapping];"
108+
109+
- name: Cache NuGet packages
110+
uses: actions/cache@v5
111+
with:
112+
path: ~/.nuget/packages
113+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props', '**/packages.lock.json', 'global.json', '**/nuget.config', '**/NuGet.Config') }}
114+
restore-keys: |
115+
${{ runner.os }}-nuget-
116+
117+
- name: Install Versionize
118+
run: dotnet tool install --global Versionize
119+
120+
- name: Setup git
121+
run: |
122+
git config --local user.email "$GIT_USER_EMAIL"
123+
git config --local user.name "$GIT_USER_NAME"
124+
125+
- name: Versionize Release
126+
id: versionize
127+
run: versionize --exit-insignificant-commits
128+
continue-on-error: true
129+
130+
- name: Restore dependencies
131+
run: dotnet restore "$SOLUTION_FILE"
132+
133+
- name: Build
134+
run: dotnet build "$SOLUTION_FILE" --no-restore --configuration $BUILD_CONFIG
135+
136+
- name: Test
137+
run: dotnet test "$SOLUTION_FILE" /p:CollectCoverage=true /p:CoverletOutput=TestResults-${{ matrix.dotnet-version }}/ /p:CoverletOutputFormat=lcov /p:Configuration=$BUILD_CONFIG --no-build --verbosity normal --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}" $TEST_FILTER
138+
139+
- name: Upload test results
140+
uses: actions/upload-artifact@v7
141+
with:
142+
name: dotnet-results-${{ matrix.dotnet-version }}
143+
path: TestResults-${{ matrix.dotnet-version }}
144+
if: ${{ always() }}
145+
146+
- name: Publish coverage report to coveralls.io
147+
uses: coverallsapp/github-action@v2
148+
if: ${{ env.COVERALLS_UPLOAD != '' }}
149+
with:
150+
path-to-lcov: ${{ env.COVERALLS_UPLOAD }}
151+
github-token: ${{ secrets.GITHUB_TOKEN }}
152+
format: lcov
153+
fail-on-error: false
154+
155+
- name: Upload NuGet package
156+
uses: actions/upload-artifact@v7
157+
with:
158+
name: NugetPackage
159+
path: ./**/*.nupkg
160+
if: steps.versionize.outcome == 'success'
161+
162+
- name: Upload Symbol package
163+
uses: actions/upload-artifact@v7
164+
with:
165+
name: SymbolPackage
166+
path: ./**/*.snupkg
167+
if: steps.versionize.outcome == 'success'
168+
169+
- name: Push changes to Github
170+
if: steps.versionize.outcome == 'success'
171+
uses: ad-m/github-push-action@v1.0.0
172+
with:
173+
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
174+
branch: ${{ github.ref }}
175+
force: true
176+
tags: true
177+
178+
- name: Upload package to NuGet
179+
if: steps.versionize.outcome == 'success'
180+
run: dotnet nuget push "**/*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)