Skip to content

try workflow for testing #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 34 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,42 @@ jobs:
path: .
fetch-depth: 0 # avoid shallow clone with no tags

- name: Install Mamba
run: |
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh" -O mambaforge.sh
bash mambaforge.sh -b -p $HOME/mambaforge
echo "$HOME/mambaforge/bin" >> $GITHUB_PATH
source $HOME/mambaforge/etc/profile.d/conda.sh
conda init bash
- name: initialize miniconda
# this uses a marketplace action that sets up miniconda in a way that makes
# it easier to use. I tried setting it up without this and it was a pain
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
# environment.yml file is needed by this action. Because I don't want
# maintain this but rather maintain the requirements files it just has
# basic things in it like conda and pip
environment-file: ./environment.yml
python-version: 3
auto-activate-base: false

- name: Create conda environment
- name: install diffpy.pdfgui requirements
shell: bash -l {0}
run: |
source $HOME/mambaforge/etc/profile.d/conda.sh
conda create -n test_env python=3.12 xonsh regolith -c conda-forge -y
conda activate test_env
pip install case_insensitive_dict
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda activate test
conda install --file requirements/run.txt
conda install --file requirements/test.txt
pip install .

- name: Install Xvfb
run: sudo apt-get install -y xvfb

- name: Install dependencies
- name: Start Xvfb
run: |
source $HOME/mambaforge/etc/profile.d/conda.sh
conda activate test_env
mamba install --file requirements/run.txt
mamba install --file requirements/test.txt
pip install -e .
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x16 &

- name: Use Xvfb Action
uses: GabrielBB/xvfb-action@v1
with:
run: |
bash -c "source $HOME/mambaforge/etc/profile.d/conda.sh && conda activate test_env && python -m run_tests.py"
- name: Validate diffpy.pdfgui
shell: bash -l {0}
run: |
export DISPLAY=:99
conda activate test
coverage run -m pytest -vv -s
coverage report -m
codecov
5 changes: 0 additions & 5 deletions run_tests.py

This file was deleted.

161 changes: 0 additions & 161 deletions setup.py

This file was deleted.

5 changes: 5 additions & 0 deletions src/diffpy/pdfgui/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import json
import subprocess
from pathlib import Path

import pytest


def pytest_collection_modifyitems(session, config, items):
subprocess.run(["python", "-m", "diffpy.pdfgui.tests.rundeps"], check=True)


@pytest.fixture
def user_filesystem(tmp_path):
base_dir = Path(tmp_path)
Expand Down
Loading