gitea workflows: fix pytest dependency bug and add bec_lib to dependencies
This commit is contained in:
@@ -21,38 +21,54 @@ env:
|
||||
PYTHONPATH: src
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-test-${{ hashFiles('**/pyproject.toml') }}
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set Up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Set Up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
|
||||
pip install pytest pytest-cov pytest-mock pytest-qt
|
||||
|
||||
pip install \
|
||||
--index-url https://${{ secrets.GITEA_USER }}:${{ secrets.GITEA_TOKEN }}@gitea.psi.ch/api/packages/mx/pypi/simple/ \
|
||||
--extra-index-url https://pypi.org/simple \
|
||||
-e .
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-test-${{ hashFiles('**/pyproject.toml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-test-
|
||||
|
||||
- name: Run tests with pytest
|
||||
run: |
|
||||
pytest --cov=aare --cov-report=xml tests/unit
|
||||
- name: Create virtual environment
|
||||
run: |
|
||||
python -m venv venv
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
PIP_INDEX_URL: https://${{ secrets.GITEA_USER }}:${{ secrets.GITEA_TOKEN }}@gitea.psi.ch/api/packages/mx/pypi/simple/
|
||||
PIP_EXTRA_INDEX_URL: https://pypi.org/simple
|
||||
run: |
|
||||
source venv/bin/activate
|
||||
|
||||
python -m pip install --upgrade pip
|
||||
|
||||
pip install pytest pytest-cov pytest-mock pytest-qt
|
||||
|
||||
pip install -e .
|
||||
|
||||
- name: Run tests with pytest
|
||||
env:
|
||||
PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1"
|
||||
run: |
|
||||
source venv/bin/activate
|
||||
|
||||
pytest \
|
||||
-p pytest_cov \
|
||||
--cov=aare \
|
||||
--cov-report=xml \
|
||||
tests/unit
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
|
||||
@@ -23,6 +23,8 @@ dependencies = [
|
||||
"websocket-client==1.8.0",
|
||||
"sseclient-py==1.8.0",
|
||||
"psi-pshell==2.1.0",
|
||||
"bec_lib==3.117.3",
|
||||
"bec-ipython-client==3.117.3",
|
||||
]
|
||||
|
||||
[lint]
|
||||
|
||||
Reference in New Issue
Block a user