Skip to content

Add sqlite support ๐Ÿ—„๏ธ #8

Add sqlite support ๐Ÿ—„๏ธ

Add sqlite support ๐Ÿ—„๏ธ #8

Workflow file for this run

name: Publish Database Images
on:
push:
tags:
- "*.*.*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install Tiled.
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip'
- run: pip install -r requirements.txt
- name: Start PostgreSQL service in container.
shell: bash -l {0}
run: |
set -e
docker run -d --rm --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=secret -d docker.io/postgres
docker ps
- name: Run Tiled commands
id: tiled
shell: bash -l {0}
run: source scripts/run_tiled.sh
env:
# Specify Database Connection
TILED_TEST_POSTGRESQL_URI: postgresql+asyncpg://postgres:secret@localhost:5432
- name: SANITY CHECK - list contents of table nodes
run: docker exec postgres psql -U postgres -c "SELECT * FROM nodes limit 10;"
- name: Dump sql data into binary format when generator finishes
id: save
if: steps.tiled.conclusion == 'success'
run: docker exec -i postgres /bin/bash -c "PGPASSWORD=secret pg_dump --username postgres postgres" > tiled_test_db_pg.sql
- name: SANITY CHECK - list contents of sqlite file
run : sqlite3 tiled_test_db_sqlite.db "SELECT * FROM nodes LIMIT 10"
- name: Publish .sql files to github release with action
if: steps.save.conclusion == 'success'
uses: softprops/action-gh-release@v1
with:
files: |
tiled_test_db_pg.sql
tiled_test_db_sqlite.db
tag_name: ${{ github.ref_name }}
body: |
${{ github.ref_name }} : ${{ github.event.head_commit.message }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}