Skip to content

ci: Use 'setup-mariadb' action instead of docker container #419

ci: Use 'setup-mariadb' action instead of docker container

ci: Use 'setup-mariadb' action instead of docker container #419

Workflow file for this run

name: Capture.The.Flag
on:
push:
branches:
- dev
pull_request:
branches:
- dev
env:
DOTNET_VERSION: '8.x'
jobs:
unit_testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Execute unit tests
run: dotnet test ./tests/Application.Tests/CTF.Application.Tests.csproj -c Release
integration_testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install MariaDB
uses: ankane/setup-mariadb@v1
with:
database: gamemode
run: |
mariadb -uroot -e "CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin'"
mariadb -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost'"
mariadb -uroot -e "FLUSH PRIVILEGES"
mariadb -uroot gamemode < ./scripts/mariadb/gamemode.sql
- name: Check MariaDB version
run: mariadb --version
- name: Check SQLite version
run: sqlite3 --version
- name: Create SQLite database
run: sqlite3 gamemode.db < ./scripts/sqlite/gamemode.sql
- name: Create .env.test file
run: cp ./tests/Persistence.Tests/.env.test.example ./tests/Persistence.Tests/.env.test
- name: Execute integration tests
run: dotnet test ./tests/Persistence.Tests/Persistence.Tests.csproj -c Release