Skip to content

Commit

Permalink
validates sql in unit testing
Browse files Browse the repository at this point in the history
  • Loading branch information
harryob committed Apr 29, 2024
1 parent e74e9c4 commit 0a54653
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,24 @@ on:
jobs:
run_unit_tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306
steps:
- uses: actions/checkout@v3
- name: Restore BYOND cache
uses: actions/cache@v3
with:
path: ~/BYOND
key: ${{ runner.os }}-byond-${{ secrets.CACHE_PURGE_KEY }}
- name: Setup database
run: |
sudo systemctl start mysql
mysql -u root -proot -e 'CREATE DATABASE cmdb;'
- name: Install rust-g
run: |
sudo dpkg --add-architecture i386
Expand Down
26 changes: 17 additions & 9 deletions tools/ci/ci_config.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
SQL_ENABLED
ADDRESS 127.0.0.1
PORT 3306
FEEDBACK_DATABASE tg_ci
FEEDBACK_TABLEPREFIX
FEEDBACK_LOGIN root
FEEDBACK_PASSWORD
LAVALAND_BUDGET 0
SPACE_BUDGET 0
# server adapter
DB_PROVIDER brsql

# server address
DB_ADDRESS localhost

# server port
DB_PORT 3306

# server db
DB_DATABASE cmdb

# server login
DB_USERNAME root

# server password
DB_PASSWORD password
4 changes: 4 additions & 0 deletions tools/ci/run_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ MAP=$1
echo Testing $MAP

tools/deploy.sh ci_test
mkdir ci_test/config
mkdir ci_test/data

#test config
cp tools/ci/ci_config.txt ci_test/config/config.txt

#set the map
cp maps/$MAP.json ci_test/data/next_map.json
cp maps/templates/space.json ci_test/data/next_ship.json
Expand Down

0 comments on commit 0a54653

Please sign in to comment.