1010 branches : [master]
1111 paths-ignore : ["**/*.md", docs/**]
1212 workflow_dispatch :
13- # make this workflow reusable by release.yml
14- workflow_call :
13+ workflow_call : # make this workflow reusable by release.yml
1514
1615permissions :
1716 contents : read
@@ -20,86 +19,67 @@ jobs:
2019 test :
2120 # prevent this action from running on forks
2221 if : github.repository == 'materialsproject/pymatgen'
22+ defaults :
23+ run :
24+ shell : bash -l {0} # enables conda/mamba env activation by reading bash profile
2325 strategy :
2426 fail-fast : false
2527 matrix :
2628 # pytest-split automatically distributes work load so parallel jobs finish in similar time
2729 os : [ubuntu-latest, windows-latest]
28- python-version : ["3.9", "3.11 "]
30+ python-version : ["3.9", "3.12 "]
2931 split : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
3032 # include/exclude is meant to maximize CI coverage of different platforms and python
3133 # versions while minimizing the total number of jobs. We run all pytest splits with the
3234 # oldest supported python version (currently 3.9) on windows (seems most likely to surface
33- # errors) and with newest version (currently 3.11 ) on ubuntu (to get complete and speedy
35+ # errors) and with newest version (currently 3.12 ) on ubuntu (to get complete and speedy
3436 # coverage on unix). We ignore mac-os, which is assumed to be similar to ubuntu.
3537 exclude :
3638 - os : windows-latest
37- python-version : " 3.11 "
39+ python-version : " 3.12 "
3840 - os : ubuntu-latest
3941 python-version : " 3.9"
4042
4143 runs-on : ${{ matrix.os }}
4244
4345 env :
4446 PMG_MAPI_KEY : ${{ secrets.PMG_MAPI_KEY }}
45- MPLBACKEND : Agg # https://github.com/orgs/community/discussions/26434
46- PMG_TEST_FILES_DIR : ${{ github.workspace }}/tests/files
47- GULP_LIB : ${{ github.workspace }}/cmd_line/gulp/Libraries
4847 PMG_VASP_PSP_DIR : ${{ github.workspace }}/tests/files
4948
5049 steps :
51- - uses : actions/checkout@v4
52- - name : Set up Python ${{ matrix.python-version }}
53- uses : actions/setup-python@v5
54- with :
55- python-version : ${{ matrix.python-version }}
56- cache : pip
57- cache-dependency-path : setup.py
58- - name : Copy GULP to bin
59- if : matrix.os == 'ubuntu-latest'
60- run : |
61- sudo cp cmd_line/gulp/Linux_64bit/* /usr/local/bin/
62- - name : Install Bader
63- if : matrix.os == 'ubuntu-latest'
64- run : |
65- wget http://theory.cm.utexas.edu/henkelman/code/bader/download/bader_lnx_64.tar.gz
66- tar xvzf bader_lnx_64.tar.gz
67- sudo mv bader /usr/local/bin/
68- continue-on-error : true # This is not critical to succeed.
69- - name : Install Enumlib
70- if : matrix.os == 'ubuntu-latest'
50+ - name : Check out repo
51+ uses : actions/checkout@v4
52+
53+ - name : Set up micromamba
54+ uses : mamba-org/setup-micromamba@main
55+
56+ - name : Create mamba environment
7157 run : |
72- git clone --recursive https://github.com/msg-byu/enumlib.git
73- cd enumlib/symlib/src
74- export F90=gfortran
75- make
76- cd ../../src
77- make enum.x
78- sudo mv enum.x /usr/local/bin/
79- cd ..
80- sudo cp aux_src/makeStr.py /usr/local/bin/
81- continue-on-error : true # This is not critical to succeed.
82- - name : Install Packmol
58+ micromamba create -n pmg python=${{ matrix.python-version }} --yes
59+
60+ - name : Install uv
61+ run : micromamba run -n pmg pip install uv
62+
63+ - name : Install ubuntu-only conda dependencies
8364 if : matrix.os == 'ubuntu-latest'
8465 run : |
85- wget -O packmol.tar.gz https://github.com/m3g/packmol/archive/refs/tags/v20.14.2.tar.gz
86- tar xvzf packmol.tar.gz
87- export F90=gfortran
88- cd packmol-20.14.2
89- ./configure
90- make
91- sudo mv packmol /usr/local/bin/
92- cd ..
93- continue-on-error : true # This is not critical to succeed.
94- - name : Install dependencies
66+ micromamba install -n pmg -c conda-forge enumlib packmol bader openbabel openff-toolkit --yes
67+
68+ - name : Install pymatgen and dependencies
9569 run : |
96- python -m pip install numpy cython
70+ micromamba activate pmg
71+ # TODO remove temporary fix. added since uv install torch is flaky.
72+ # track https://github.com/astral-sh/uv/issues/1921 for resolution
73+ pip install torch
74+
75+ uv pip install numpy cython
9776
98- # TODO remove next line installing ase from main branch until FrechetCellFilter is released
99- pip install git+https://gitlab.com/ase/ase
77+ uv pip install --editable '.[dev,optional]'
10078
101- python -m pip install -e '.[dev,optional]'
79+ # TODO remove next line installing ase from main branch when FrechetCellFilter is released
80+ uv pip install --upgrade 'git+https://gitlab.com/ase/ase'
10281
10382 - name : pytest split ${{ matrix.split }}
10483 run : |
84+ micromamba activate pmg
10585 pytest --splits 10 --group ${{ matrix.split }} --durations-path tests/files/.pytest-split-durations tests
0 commit comments