Fix release workflow #1307
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Test | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- 'docs/**' | |
pull_request: | |
branches: [ main ] | |
paths-ignore: | |
- 'docs/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.10', '3.11', '3.12'] | |
env: | |
WOKCALIB_DIR: '/home/runner/work/jaeger/jaeger/fps_calibrations/apo/wok_calibs/sloanFlatCMM' | |
PYTHONPATH: '/home/runner/work/jaeger/jaeger/fps_calibrations' | |
OBSERVATORY: 'APO' | |
RS_VERSION: 'eta-6' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout fps_calibrations | |
uses: actions/checkout@v4 | |
with: | |
repository: sdss/fps_calibrations | |
path: fps_calibrations | |
ref: '2024.04.01' | |
- name: Restore large test files files | |
id: cache-fcam | |
uses: actions/cache@v4 | |
with: | |
path: /home/runner/work/jaeger/jaeger/tests/data/fcam | |
key: ${{ runner.os }}-tests-fcam | |
- name: Setup uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
enable-cache: true | |
- name: Install package | |
run: | | |
uv python install ${{ matrix.python-version }} | |
uv venv --python ${{ matrix.python-version }} | |
uv sync --no-dev | |
- name: Install Postgresql | |
uses: ikalnytskyi/action-setup-postgres@v5 | |
with: | |
username: sdss | |
id: postgres | |
- name: Install Q3C | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y postgresql-server-dev-14 | |
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_jaeger_test | |
psql -c "CREATE EXTENSION q3c;" -d sdss5db_jaeger_test | |
env: | |
PGSERVICE: ${{ steps.postgres.outputs.service-name }} | |
- name: Populate database | |
run: | | |
cd tests/data/sdss5db/targetdb | |
psql sdss5db_jaeger_test < targetdb.sql | |
psql sdss5db_jaeger_test < restore_sample_files.sql | |
cd ../opsdb_apo | |
psql sdss5db_jaeger_test < opsdb_apo.sql | |
env: | |
PGSERVICE: ${{ steps.postgres.outputs.service-name }} | |
- name: Test with pytest | |
run: | | |
uv pip install pytest pytest-mock pytest-asyncio pytest-cov pyserial-asyncio | |
uv run pytest | |
env: | |
PGSERVICE: ${{ steps.postgres.outputs.service-name }} | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml |