10
10
branches : [master]
11
11
paths-ignore : ["**/*.md", docs/**]
12
12
workflow_dispatch :
13
- # make this workflow reusable by release.yml
14
- workflow_call :
13
+ workflow_call : # make this workflow reusable by release.yml
15
14
16
15
permissions :
17
16
contents : read
@@ -20,86 +19,67 @@ jobs:
20
19
test :
21
20
# prevent this action from running on forks
22
21
if : github.repository == 'materialsproject/pymatgen'
22
+ defaults :
23
+ run :
24
+ shell : bash -l {0} # enables conda/mamba env activation by reading bash profile
23
25
strategy :
24
26
fail-fast : false
25
27
matrix :
26
28
# pytest-split automatically distributes work load so parallel jobs finish in similar time
27
29
os : [ubuntu-latest, windows-latest]
28
- python-version : ["3.9", "3.11 "]
30
+ python-version : ["3.9", "3.12 "]
29
31
split : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
30
32
# include/exclude is meant to maximize CI coverage of different platforms and python
31
33
# versions while minimizing the total number of jobs. We run all pytest splits with the
32
34
# 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
34
36
# coverage on unix). We ignore mac-os, which is assumed to be similar to ubuntu.
35
37
exclude :
36
38
- os : windows-latest
37
- python-version : " 3.11 "
39
+ python-version : " 3.12 "
38
40
- os : ubuntu-latest
39
41
python-version : " 3.9"
40
42
41
43
runs-on : ${{ matrix.os }}
42
44
43
45
env :
44
46
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
48
47
PMG_VASP_PSP_DIR : ${{ github.workspace }}/tests/files
49
48
50
49
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
71
57
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
83
64
if : matrix.os == 'ubuntu-latest'
84
65
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
95
69
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
97
76
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]'
100
78
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'
102
81
103
82
- name : pytest split ${{ matrix.split }}
104
83
run : |
84
+ micromamba activate pmg
105
85
pytest --splits 10 --group ${{ matrix.split }} --durations-path tests/files/.pytest-split-durations tests
0 commit comments