mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Merge pull request #114 from AnonymusRaccoon/feat/robot-ci
Add robot CI
This commit is contained in:
commit
ee20ab496f
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -54,7 +54,7 @@ jobs:
|
|||||||
LIBPATH: ${{env.LIBPATH}};C:\Program Files\FFmpeg\lib
|
LIBPATH: ${{env.LIBPATH}};C:\Program Files\FFmpeg\lib
|
||||||
CFLAGS: -I/usr/local/include
|
CFLAGS: -I/usr/local/include
|
||||||
LDFLAGS: -L/usr/local/lib
|
LDFLAGS: -L/usr/local/lib
|
||||||
run: dotnet publish -r ${{matrix.runtime}} -c Release -o dist ${{env.PROJECT}}
|
run: dotnet publish -r ${{matrix.runtime}} --self-contained -c Release -o dist ${{env.PROJECT}}
|
||||||
- name: Compression output
|
- name: Compression output
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
33
.github/workflows/robot.yml
vendored
Normal file
33
.github/workflows/robot.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: RobotTests
|
||||||
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Build the app
|
||||||
|
run: docker-compose build
|
||||||
|
|
||||||
|
- name: Start the service
|
||||||
|
run: docker-compose up -d
|
||||||
|
|
||||||
|
- name: Perform healthchecks
|
||||||
|
run: |
|
||||||
|
docker-compose ps -a
|
||||||
|
wget --retry-connrefused http://localhost:5000 # /healthcheck
|
||||||
|
|
||||||
|
- name: Run robot tests
|
||||||
|
run: |
|
||||||
|
pip install -r tests/robot/requirements.txt
|
||||||
|
robot -d out tests/robot/
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: results
|
||||||
|
path: out
|
||||||
|
|
@ -9,7 +9,7 @@ services:
|
|||||||
- BASICS__PUBLICURL=http://localhost:5000
|
- BASICS__PUBLICURL=http://localhost:5000
|
||||||
- DATABASE__ENABLED=postgres
|
- DATABASE__ENABLED=postgres
|
||||||
- DATABASE__CONFIGURATIONS__POSTGRES__SERVER=postgres
|
- DATABASE__CONFIGURATIONS__POSTGRES__SERVER=postgres
|
||||||
- DATABASE__CONFIGURATIONS__POSTGRES__USER ID=kyoo
|
- DATABASE__CONFIGURATIONS__POSTGRES__USER=kyoo
|
||||||
- DATABASE__CONFIGURATIONS__POSTGRES__PASSWORD=kyooPassword
|
- DATABASE__CONFIGURATIONS__POSTGRES__PASSWORD=kyooPassword
|
||||||
- TVDB__APIKEY=${TVDB__APIKEY}
|
- TVDB__APIKEY=${TVDB__APIKEY}
|
||||||
- THEMOVIEDB__APIKEY=${THEMOVIEDB__APIKEY}
|
- THEMOVIEDB__APIKEY=${THEMOVIEDB__APIKEY}
|
||||||
|
@ -34,10 +34,21 @@ namespace Kyoo.Database
|
|||||||
/// <returns>A parsed connection string</returns>
|
/// <returns>A parsed connection string</returns>
|
||||||
public static string GetDatabaseConnection(this IConfiguration config, string database)
|
public static string GetDatabaseConnection(this IConfiguration config, string database)
|
||||||
{
|
{
|
||||||
|
static string ToDbProperty(string key)
|
||||||
|
{
|
||||||
|
return key switch
|
||||||
|
{
|
||||||
|
"USER" => "USER ID",
|
||||||
|
_ => key
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
DbConnectionStringBuilder builder = new();
|
DbConnectionStringBuilder builder = new();
|
||||||
IConfigurationSection section = config.GetSection("database:configurations").GetSection(database);
|
IConfigurationSection section = config.GetSection("database:configurations").GetSection(database);
|
||||||
foreach (IConfigurationSection child in section.GetChildren())
|
foreach (IConfigurationSection child in section.GetChildren())
|
||||||
builder[child.Key] = child.Value;
|
{
|
||||||
|
builder[ToDbProperty(child.Key)] = child.Value;
|
||||||
|
}
|
||||||
return builder.ConnectionString;
|
return builder.ConnectionString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user