forked from materialsproject/pymatgen
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (89 loc) · 3.28 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release
on:
release:
types: [ created ]
workflow_dispatch:
jobs:
test:
# prevent this action from running on forks
if: github.repository == 'materialsproject/pymatgen'
strategy:
max-parallel: 20
matrix:
# This distribution of tests is designed to ensure an approximately even time to finish for parallel jobs.
include:
- pkg: pymatgen/analysis/defects pymatgen/analysis/chemenv pymatgen/analysis/elasticity pymatgen/analysis/magnetism
pkg_id: 1
- pkg: pymatgen/analysis --ignore=pymatgen/analysis/defects --ignore=pymatgen/analysis/chemenv --ignore=pymatgen/analysis/elasticity --ignore=pymatgen/analysis/magnetism
pkg_id: 2
- pkg: pymatgen/electronic_structure pymatgen/symmetry pymatgen/command_line
pkg_id: 3
- pkg: pymatgen --ignore=pymatgen/analysis --ignore=pymatgen/electronic_structure --ignore=pymatgen/symmetry --ignore=pymatgen/ext --ignore=pymatgen/command_line
pkg_id: 4
runs-on: macos-latest
env:
PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}
MPLBACKEND: "Agg"
PMG_TEST_FILES_DIR: ${{ github.workspace }}/test_files
GULP_LIB: ${{ github.workspace }}/cmd_line/gulp/Libraries
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: actions/cache@v2
with:
path: ~/Library/Caches/pip # needs to change if `runs-on: macos` changes
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install --upgrade pip wheel
pip install -r requirements.txt
pip install -r requirements-optional.txt -r requirements-dev.txt
pip install -e .
- name: pytest ${{ matrix.pkg }}
run: |
pytest ${{ matrix.pkg }}
release:
needs: test
strategy:
max-parallel: 2
matrix:
os: [ macos-latest, windows-latest ]
python-version: [ '3.8', '3.9', '3.10' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
id: cache-dir
run: |
echo "::set-output name=dir::$(pip cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.cache-dir.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install --upgrade pip wheel
pip install -r requirements.txt
pip install -e .
- name: Release
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
pip install setuptools wheel twine
rm -rf test_files
python setup.py sdist bdist_wheel
twine upload --skip-existing dist/*.whl
twine upload --skip-existing dist/*.tar.gz
continue-on-error: true