2022-07-17 13:11:13 +02:00
|
|
|
name: migrations
|
|
|
|
|
|
|
|
on: [pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
sqlite-to-postgres:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:latest
|
|
|
|
env:
|
2022-08-17 15:42:01 +02:00
|
|
|
POSTGRES_USER: lnbits
|
|
|
|
POSTGRES_PASSWORD: lnbits
|
|
|
|
POSTGRES_DB: migration
|
2022-07-17 13:11:13 +02: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 17:44:52 +02:00
|
|
|
python-version: ["3.9"]
|
2023-07-11 12:46:40 +02:00
|
|
|
poetry-version: ["1.5.1"]
|
2022-07-17 13:11:13 +02:00
|
|
|
steps:
|
2023-01-29 11:46:20 +01:00
|
|
|
- uses: actions/checkout@v3
|
2022-09-27 17:44:52 +02:00
|
|
|
- name: Set up Poetry ${{ matrix.poetry-version }}
|
|
|
|
uses: abatilo/actions-poetry@v2
|
|
|
|
with:
|
|
|
|
poetry-version: ${{ matrix.poetry-version }}
|
2023-07-11 12:46:40 +02:00
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
cache: "poetry"
|
2022-07-17 13:11:13 +02:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2022-08-03 14:10:32 +02:00
|
|
|
poetry install
|
2022-07-25 09:13:41 +02:00
|
|
|
sudo apt install unzip
|
2022-07-17 13:11:13 +02:00
|
|
|
- name: Run migrations
|
|
|
|
run: |
|
2022-08-17 15:42:01 +02:00
|
|
|
make test-migration
|