diff --git a/.github/actions/unittests/action.yml b/.github/actions/unittests/action.yml index 5b7b0776..5b258a0f 100644 --- a/.github/actions/unittests/action.yml +++ b/.github/actions/unittests/action.yml @@ -47,31 +47,32 @@ runs: if: | steps.cache.outputs.cache-hit == 'true' shell: "bash" - env: - IMPORT_MYSQL: "mysql --user=nautobot --password=$MYSQL_PASSWORD" - IMPORT_POSTGRES: "psql --username=nautobot postgres" run: | cd development docker compose exec -- db sh -c \ - '${{ inputs.db-backend == 'mysql' && env.IMPORT_MYSQL || env.IMPORT_POSTGRES }}' \ + '${{ inputs.db-backend == 'mysql' && + 'mysql --user=nautobot --password=$MYSQL_PASSWORD' || + 'psql --username=nautobot postgres' + }}' \ < dump.sql - name: "Build Database Dump" if: | steps.cache.outputs.cache-hit != 'true' shell: "bash" - env: - BACKUP_MYSQL: "mysqldump --user=root --password=$MYSQL_ROOT_PASSWORD --databases test_nautobot" - BACKUP_POSTGRES: "pg_dump --clean --create --username=nautobot --dbname=test_nautobot" - CREATE_MYSQL: "mysql -u nautobot -e \"CREATE DATABASE test_nautobot;\"" - CREATE_POSTGRES: "createdb --user=nautobot test_nautobot" run: | cd development docker compose exec -- db sh -c \ - '${{ inputs.db-backend == 'mysql' && env.CREATE_MYSQL || env.CREATE_POSTGRES }}' + '${{ inputs.db-backend == 'mysql' && + 'mysql -u nautobot -e "CREATE DATABASE test_nautobot;"' || + 'createdb --user=nautobot test_nautobot' + }}' docker compose run --rm --entrypoint='' --env=NAUTOBOT_DB_NAME=test_nautobot -- nautobot \ nautobot-server migrate docker compose exec -- db sh -c \ - '${{ inputs.db-backend == 'mysql' && env.BACKUP_MYSQL || env.BACKUP_POSTGRES }}' \ + '${{ inputs.db-backend == 'mysql' && + 'mysqldump --user=root --password=$MYSQL_ROOT_PASSWORD --databases test_nautobot' || + 'pg_dump --clean --create --username=nautobot --dbname=test_nautobot' + }}' \ > dump.sql - name: "Unit Tests" shell: "bash"