generated from Kentico/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 2
119 lines (103 loc) · 3.04 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: "CI: Build and Test"
on:
push:
branches: [main, feat/github-actions-pipeline]
paths:
- "**.cs"
- "**.cshtml"
- "**.tsx"
- "**.js"
- "**.json"
- "**.csproj"
- "**.props"
- "**.targets"
- "**.sln"
- "**.yml"
pull_request:
branches: [main]
paths:
- "**.cs"
- "**.cshtml"
- "**.tsx"
- "**.js"
- "**.json"
- "**.csproj"
- "**.props"
- "**.targets"
- "**.sln"
jobs:
build:
runs-on: ubuntu-latest
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
SA_PASSWORD: "Your_password123"
ACCEPT_EULA: "Y"
ports:
- 1433:1433
options: >-
--health-cmd "exit 0"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
# - name: Install sqlcmd
# run: |
# sudo apt-get update
# sudo ACCEPT_EULA=y apt-get install -y mssql-tools unixodbc-dev
# echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
# source ~/.bashrc
# - name: Wait for SQL Server to be ready
# run: |
# for i in {1..30}; do
# if /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -Q "SELECT 1" &> /dev/null; then
# echo "SQL Server is up and running"
# break
# fi
# echo "Waiting for SQL Server to be ready..."
# sleep 2
# done
# - name: Print SQL Server name
# run: |
# /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -Q "SELECT @@SERVERNAME"
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
- name: Install dependencies
run: |
dotnet restore --locked-mode
- name: Build Solution
run: |
dotnet build --configuration Release --no-restore
- name: Get kentico template
run: |
dotnet new -i Kentico.Xperience.Templates
- name: Create Kentico Xperience project
run: |
mkdir xbk
cd xbk
echo "y" | dotnet new kentico-xperience-mvc -n kentico-boilerplate
- name: Tool restore
run: |
dotnet tool restore
- name: Create Kentico database
run: |
cd xbk
dotnet kentico-xperience-dbmanager -- -s "localhost" -d "pwtest" -u sa -p $SA_PASSWORD -a "admin" --hash-string-salt "<hash_string_salt>" --license-file "<license_file_path>"
- name: Run Kentico Xperience project
run: |
cd xbk
dotnet run
# TODO how to get licence file
####### The only tests present are now Playwright NUnit tests,
####### which aren't properly integrated into this pipeline
# - name: Test Solution
# run: |
# dotnet test `
# --configuration Release `
# --no-build `
# --no-restore