Skip to content

Commit ea7ce43

Browse files
authored
Create continuous-integration-workflow.yml
1 parent b347fae commit ea7ce43

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Continuous Integration
2+
on: [push]
3+
env:
4+
BuildParameters.RestoreBuildProjects: '**/*.csproj'
5+
BuildParameters.TestProjects: '**/*[Tt]ests/*.csproj'
6+
BuildParameters.projects: '**/*.csproj'
7+
BuildParameters.sqlprojects: '**/*.sqlproj'
8+
jobs:
9+
build:
10+
name: Build and test
11+
runs-on: windows-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Setup .NET Core SDK 6.0
16+
uses: actions/setup-dotnet@v3
17+
with:
18+
dotnet-version: 6.0.x
19+
20+
- name: Add Azure artifact
21+
run: dotnet nuget add source 'https://pkgs.dev.azure.com/e-LfH/_packaging/LearningHubFeed/nuget/v3/index.json' --name 'LearningHubFeed' --username 'kevin.whittaker' --password ${{ secrets.AZURE_DEVOPS_PAT }} --store-password-in-clear-text
22+
23+
- name: Use NuGet 5.8
24+
uses: nuget/setup-nuget@v1
25+
26+
- name: Use Node 12.19
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '12.19'
30+
31+
- name: Install dependencies
32+
run: |
33+
cd ./Auth/LearningHub.Nhs.Auth
34+
npm install -f
35+
36+
- name: Run Webpack build
37+
run: |
38+
cd ./Auth/LearningHub.Nhs.Auth
39+
npm run build
40+
41+
- name: Setup MSBuild
42+
uses: microsoft/[email protected]
43+
44+
- name: Build SQL Server Database project
45+
run: |
46+
# List all .sqlproj files except for .sqlproj
47+
$sqlproj_files = Get-ChildItem -Path . -Filter *.sqlproj -Recurse
48+
49+
# Build each .csproj file
50+
foreach ($sqlproj_file in $sqlproj_files) {
51+
Write-Host "Building $($sqlproj_file.FullName)"
52+
msbuild "$($sqlproj_file.FullName)" /p:Configuration=Release
53+
}
54+
55+
- name: Build solution excluding SQL project
56+
run: |
57+
# List all .csproj files except for .sqlproj
58+
$csproj_files = Get-ChildItem -Path . -Filter *.csproj -Recurse | Where-Object { $_.FullName -notmatch '\\.sqlproj$' }
59+
60+
# Build each .csproj file
61+
foreach ($csproj_file in $csproj_files) {
62+
Write-Host "Building $($csproj_file.FullName)"
63+
dotnet build "$($csproj_file.FullName)"
64+
}
65+
66+
#- name: Test
67+
# run: dotnet test ${{ env.BuildParameters.TestProjects }}

0 commit comments

Comments
 (0)