Add Application configuration #11
.envDbInitializer.csDependencyInjection.cs
.gitea/workflows
ApiDto
Common
Requests
Application/Common/Mappings
Backend.slnEndpoint
Common
Attributes
Exceptions
Interfaces
Services
Configuration
EnvironmentManager.cs
General
Swagger
Controllers
Endpoint.csprojMiddleware
Program.csProperties
Persistence
Security
SqlData
Application
Application.csprojDependencyInjection.cs
Common
Cqrs
Campus
Queries
Discipline
Queries
Faculty
Queries
Group
Queries
LectureHall
Queries
Professor
Queries
Schedule
Interfaces
Domain
Domain.csproj
Schedule
Persistence
Common
BaseDbContext.csConfigurationResolver.csDatabaseProvider.csDbContextFactory.csModelBuilderExtensions.cs
Contexts
Schedule
EntityTypeConfigurations
Mark.cs
Persistence.csprojUberDbContext.csSqlite
@ -13,34 +13,6 @@ jobs:
|
||||
db-provider: [sqlite, mysql, postgresql]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: testdb
|
||||
options: >-
|
||||
--health-cmd "mysqladmin ping --silent"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 5555:3306
|
||||
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: testdb
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U postgres"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 6666:5432
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@ -68,10 +40,28 @@ jobs:
|
||||
run: |
|
||||
jq '.DbSettings.TypeDatabase = 0 | .DbSettings.ConnectionStringSql = "Server=127.0.0.1;Port=5555;Database=testdb;Uid=root;Pwd=root;"' Settings.json > temp.json && mv temp.json Settings.json
|
||||
|
||||
- name: Install MySQL
|
||||
if: matrix.db-provider == 'mysql'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y mysql-server
|
||||
sudo service mysql start
|
||||
sudo mysql -e "CREATE DATABASE testdb; CREATE USER 'root'@'localhost' IDENTIFIED BY 'root'; GRANT ALL PRIVILEGES ON testdb.* TO 'root'@'localhost'; FLUSH PRIVILEGES;"
|
||||
|
||||
- name: Modify configuration for PostgreSQL
|
||||
if: matrix.db-provider == 'postgresql'
|
||||
run: |
|
||||
jq '.DbSettings.TypeDatabase = 2 | .DbSettings.ConnectionStringSql = "Host=127.0.0.1;Port=6666;Database=testdb;Username=postgres;Password=postgres"' Settings.json > temp.json && mv temp.json Settings.json
|
||||
|
||||
- name: Install PostgreSQL
|
||||
if: matrix.db-provider == 'postgresql'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y postgresql postgresql-contrib
|
||||
sudo service postgresql start
|
||||
sudo -u postgres psql -c "CREATE DATABASE testdb;"
|
||||
sudo -u postgres psql -c "CREATE USER postgres WITH PASSWORD 'postgres';"
|
||||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE testdb TO postgres;"
|
||||
|
||||
- name: Run tests
|
||||
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal
|
Reference in New Issue
Block a user