2022-07-17 11:11:13 +00:00
|
|
|
name: migrations
|
|
|
|
|
|
|
|
on: [pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
sqlite-to-postgres:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:latest
|
|
|
|
env:
|
2022-08-17 13:42:01 +00:00
|
|
|
POSTGRES_USER: lnbits
|
|
|
|
POSTGRES_PASSWORD: lnbits
|
|
|
|
POSTGRES_DB: migration
|
2022-07-17 11:11:13 +00:00
|
|
|
ports:
|
|
|
|
# maps tcp port 5432 on service container to the host
|
|
|
|
- 5432:5432
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-09-27 15:44:52 +00:00
|
|
|
python-version: ["3.9"]
|
2022-12-27 12:20:07 +00:00
|
|
|
poetry-version: ["1.3.1"]
|
2022-07-17 11:11:13 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2022-09-27 15:44:52 +00:00
|
|
|
- name: Set up Poetry ${{ matrix.poetry-version }}
|
|
|
|
uses: abatilo/actions-poetry@v2
|
|
|
|
with:
|
|
|
|
poetry-version: ${{ matrix.poetry-version }}
|
2022-07-17 11:11:13 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2022-08-03 12:10:32 +00:00
|
|
|
poetry install
|
2022-07-25 07:13:41 +00:00
|
|
|
sudo apt install unzip
|
2022-07-17 11:11:13 +00:00
|
|
|
- name: Run migrations
|
|
|
|
run: |
|
2022-08-17 13:42:01 +00:00
|
|
|
make test-migration
|