TEST: fix field names in optimization plan tester #453
This file contains hidden or 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://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Python application | |
on: | |
push: | |
branches: [ "main", "ci" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
env: | |
PTYCHO_CI_DATA_DIR: /local/ptycho_aux_data/ci_data | |
permissions: | |
contents: read | |
jobs: | |
lint: | |
defaults: | |
run: | |
shell: bash -l {0} | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create environment | |
id: create_env | |
run: | | |
pip install uv | |
uv venv --python 3.11 .venv_lint | |
source .venv_lint/bin/activate | |
- name: Install Ruff | |
run: uv pip install ruff | |
- name: Run Ruff | |
run: ruff check src/ --output-format=github | |
linux-x86-gpu: | |
defaults: | |
run: | |
shell: bash -l {0} | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update test data | |
id: update_test_data | |
run: | | |
PACKAGE_DIR=$(pwd) | |
cd $PTYCHO_CI_DATA_DIR | |
git pull origin main | |
cd $PACKAGE_DIR | |
- name: Create environment | |
id: create_env | |
run: | | |
pip install uv | |
uv venv --python 3.11 .venv_pytest | |
source .venv_pytest/bin/activate | |
- name: Install dependencies | |
run: | | |
uv pip install --upgrade pip | |
uv pip install pytest | |
uv pip install -r requirements.txt | |
uv pip install -e . | |
- name: List build environment | |
run: uv pip list | |
- name: Test with pytest | |
run: | | |
echo $(which python) | |
cd tests | |
pytest -s --high-tol --save-timing | |
- name: Remove environment | |
if: always() | |
run: | | |
source .venv_pytest/bin/deactivate | |
rm -rf .venv_pytest |