Skip to content

Commit

Permalink
ci: Use 'setup-mariadb' action instead of docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDave1999 committed Oct 18, 2024
1 parent 6f3c012 commit e78a0a0
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,27 @@ jobs:

integration_testing:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb
ports:
- 3306:3306
env:
MARIADB_DATABASE: gamemode
MARIADB_ROOT_PASSWORD: 123456789
options: --name mariadb
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Check sqlite3 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: Waiting for database availability
run: |
chmod u+x wait-for-it.sh
./wait-for-it.sh -t 60 127.0.0.1:3306
- name: Import databases
run: |
docker exec -i mariadb mariadb -uroot -p123456789 -h127.0.0.1 gamemode < ./scripts/mariadb/gamemode.sql
sqlite3 gamemode.db < ./scripts/sqlite/gamemode.sql
- 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
Expand Down

0 comments on commit e78a0a0

Please sign in to comment.