Skip to content

added xbk license usage from GHsecret #157

added xbk license usage from GHsecret

added xbk license usage from GHsecret #157

Workflow file for this run

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
env:
SA_PASSWORD: "Your_password123"
ACCEPT_EULA: "Y"
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 license file
run: |
echo ${{ secrets.XPERIENCE_BY_KENTICO_LICENSE }} > xbk/license.lic
- name: Create Kentico database
run: |
cd xbk
dotnet kentico-xperience-dbmanager -- -s "localhost" -d "pwtest" -u "sa" -p "$SA_PASSWORD" -a "admin" --recreate-existing-database --hash-string-salt "<hash_string_salt>" --license-file "license.lic"
- name: Run Kentico Xperience project
run: |
cd xbk
dotnet run
- name: Remove license file
run: |
rm xbk/license.lic
####### 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