From 8f8defb0e2147c13f17729b5f2f766cf0704c025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Sun, 11 Feb 2024 19:56:04 -0800 Subject: [PATCH] Update workflow to create test database --- .github/workflows/test.yml | 28 +++++++++++++++++++++++++++ tests/scripts/create_test_database.py | 1 - 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fb3407d..b80d14c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,11 +26,39 @@ jobs: python-version: ${{ matrix.python-version }} cache: 'pip' + - name: Cache sample files + id: cache-samples + uses: actions/cache@v4 + with: + path: .config/sdss + key: ${{ runner.os }}-config-sdss + + - name: Install Postgresql + uses: ikalnytskyi/action-setup-postgres@v5 + + - name: Install Q3C + run: | + wget https://github.com/segasai/q3c/archive/refs/tags/v2.0.1.tar.gz + tar xvf v2.0.1.tar.gz + cd q3c-2.0.1 + make + make install + + - name: Create database + run: | + createdb sdss5db_too_test + psql -c "CREATE EXTENSION q3c;" -d sdss5db_too_test + - name: Install dependencies run: | pip install --upgrade wheel pip setuptools pip install . + - name: Populate database + run: | + cd tests/scripts + python create_test_database.py + - name: Lint with ruff run: | pip install ruff diff --git a/tests/scripts/create_test_database.py b/tests/scripts/create_test_database.py index fe63ba3..72c6640 100644 --- a/tests/scripts/create_test_database.py +++ b/tests/scripts/create_test_database.py @@ -27,7 +27,6 @@ def create_test_database( user: str | None = None, host: str | None = None, port: int | None = None, - confirm: bool = True, ): """Recreates a simple copy of ``catalogdb`` for testing.