diff --git a/.github/workflows/test-ubuntu.yml b/.github/workflows/test-ubuntu.yml new file mode 100644 index 0000000..cc40abd --- /dev/null +++ b/.github/workflows/test-ubuntu.yml @@ -0,0 +1,40 @@ +name: Test with Ubuntu + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + fail-fast: false + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] + defaults: + run: + shell: bash -l {0} + steps: + - uses: actions/checkout@v4 + - name: Set up Python from Miniconda/conda + uses: conda-incubator/setup-miniconda@v2.2.0 + with: + miniconda-version: latest + channels: conda-forge,defaults + channel-priority: true + activate-environment: anaconda-client-env + python-version: ${{ matrix.python-version }} + - name: Install conda dependencies + run: | + printenv + conda install -y -c conda-forge python=${{ matrix.python-version }} "numpy>=1.26" scipy pytest pytest-cov coverage + - name: Install larixite and dependencies with pip + run: | + pip install ".[dev,test,doc]" + - name: Run test suite + run: | + cd tests + python -m pytest --cov=./ --cov-report=xml diff --git a/tests/test_struct.py b/tests/test_struct.py index a7a7d78..6031cce 100644 --- a/tests/test_struct.py +++ b/tests/test_struct.py @@ -3,8 +3,8 @@ from larixite.utils import get_logger logger = get_logger("larixite.test") -testdir = Path().cwd() / "tests" -structsdir = testdir / "structs" + +structsdir = Path(__file__).parent / "structs" test_structures = ( # filename_in_structsdir, absorber_str, absorber_index, occupancy ("CuO6_D4h.xyz", "Cu", 0, 1),