Remove hardcoding of g_mag and r_mag #158
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.12'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
enable-cache: true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Restore sample files | |
id: cache-samples | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/sdss/too/samples/sdss5db_too_test | |
key: ${{ runner.os }}-config-sdss | |
- name: Install Postgresql | |
uses: ikalnytskyi/action-setup-postgres@v7 | |
with: | |
username: sdss | |
id: postgres | |
- name: Install Q3C | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y postgresql-server-dev-17 libreadline8 libreadline-dev | |
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 | |
sudo make install | |
env: | |
PGSERVICE: ${{ steps.postgres.outputs.service-name }} | |
- name: Create database | |
run: | | |
createdb sdss5db_too_test | |
psql -c "CREATE EXTENSION q3c;" -d sdss5db_too_test | |
env: | |
PGSERVICE: ${{ steps.postgres.outputs.service-name }} | |
- name: Install dependencies | |
run: | | |
uv sync --no-dev --frozen | |
- name: Populate database | |
run: | | |
cd tests/scripts | |
uv run python create_test_database.py | |
env: | |
PGSERVICE: ${{ steps.postgres.outputs.service-name }} | |
- name: Test with pytest | |
run: | | |
uv pip install pytest pytest-sugar pytest-cov coverage pytest-mock | |
uv run pytest tests/ | |
env: | |
PGSERVICE: ${{ steps.postgres.outputs.service-name }} | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |