File tree Expand file tree Collapse file tree 3 files changed +50
-20
lines changed
Expand file tree Collapse file tree 3 files changed +50
-20
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [ master, main ]
6+ pull_request :
7+ branches : [ master, main ]
8+
9+ env :
10+ DOTNET_VERSION : ' 9.0.x'
11+
12+ jobs :
13+ build-and-test :
14+ runs-on : ubuntu-latest
15+
16+ steps :
17+ - name : Checkout repository
18+ uses : actions/checkout@v4
19+
20+ - name : Setup .NET
21+ uses : actions/setup-dotnet@v4
22+ with :
23+ dotnet-version : ${{ env.DOTNET_VERSION }}
24+
25+ - name : Cache NuGet packages
26+ uses : actions/cache@v4
27+ with :
28+ path : ~/.nuget/packages
29+ key : ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
30+ restore-keys : |
31+ ${{ runner.os }}-nuget-
32+
33+ - name : Restore dependencies
34+ run : dotnet restore
35+
36+ - name : Build
37+ run : dotnet build --no-restore --configuration Release
38+
39+ - name : Test
40+ run : dotnet test --no-build --configuration Release --verbosity normal
Original file line number Diff line number Diff line change 44 push :
55 branches : [ main, master ]
66 paths :
7- - ' BlazorTextDiff.Web/**'
8- - ' BlazorTextDiff/**'
7+ - ' src/ BlazorTextDiff.Web/**'
8+ - ' src/ BlazorTextDiff/**'
99 workflow_dispatch :
1010
1111# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
5757 dotnet workload restore
5858 dotnet restore
5959
60+ - name : Run tests
61+ run : dotnet test --no-restore --configuration Release --verbosity normal
62+
6063 - name : Build Blazor WebAssembly
61- run : dotnet publish BlazorTextDiff.Web/BlazorTextDiff.Web.csproj -c Release -o dist/ -p:Version=${{ steps.version.outputs.version }} -p:PublishUrl=/BlazorTextDiff/
64+ run : dotnet publish src/ BlazorTextDiff.Web/BlazorTextDiff.Web.csproj -c Release -o dist/ -p:Version=${{ steps.version.outputs.version }} -p:PublishUrl=/BlazorTextDiff/
6265
6366 - name : Add .nojekyll file
6467 run : touch dist/wwwroot/.nojekyll
Original file line number Diff line number Diff line change 1- name : Build and Publish Packages
1+ name : Publish Packages
22
33on :
4- push :
5- branches : [ master, main ]
6- paths :
7- - ' BlazorTextDiff/**'
8- pull_request :
9- branches : [ master, main ]
10- paths :
11- - ' BlazorTextDiff/**'
124 workflow_dispatch :
135
146env :
157 DOTNET_VERSION : ' 9.0.x'
16- PROJECT_PATH : ' BlazorTextDiff/BlazorTextDiff.csproj'
8+ PROJECT_PATH : ' src/ BlazorTextDiff/BlazorTextDiff.csproj'
179 ARTIFACT_NAME : ' BlazorTextDiff-Package'
1810
1911jobs :
8072 - name : Check if should publish
8173 id : check-publish
8274 run : |
83- if [[ ("${{ github.event_name }}" == "push" && ("${{ github.ref }}" == "refs/heads/master" || "${{ github.ref }}" == "refs/heads/main")) || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
84- echo "should-publish=true" >> $GITHUB_OUTPUT
85- echo "Will publish packages (triggered by: ${{ github.event_name }})"
86- else
87- echo "should-publish=false" >> $GITHUB_OUTPUT
88- echo "Will not publish packages (event: ${{ github.event_name }}, ref: ${{ github.ref }})"
89- fi
75+ echo "should-publish=true" >> $GITHUB_OUTPUT
76+ echo "Will publish packages (manual trigger)"
9077
9178 - name : Upload build artifacts
9279 uses : actions/upload-artifact@v4
You can’t perform that action at this time.
0 commit comments