-
Notifications
You must be signed in to change notification settings - Fork 6
105 lines (97 loc) · 2.92 KB
/
Copy pathpython.yml
File metadata and controls
105 lines (97 loc) · 2.92 KB
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
98
99
100
101
102
103
104
105
name: Python package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Get the repo history so we can version by number of commits
- name: Install OpenMC
run: |
yum install -y gcc-c++ cmake3 hdf5-devel
alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
--family cmake
git clone --recurse-submodules https://github.com/openmc-dev/openmc.git
cd openmc
git checkout
mkdir build && cd build
cmake ..
make
make install
- name: Build plasma source
run: |
export PYVER=${{ matrix.python-version }}
alias python=$(ls -d /opt/python/* | grep ${PYVER//.})/bin/python
python -m pip install -r requirements-develop.txt
python -m pip install auditwheel
python setup.py bdist_wheel
python -m auditwheel show dist/*.whl
python -m auditwheel repair dist/*.whl
- name: Upload wheel artifact
uses: actions/upload-artifact@v2
with:
name: dist
path: wheelhouse
test:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Download build
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Install plasma source
run: |
python -m pip install --no-index --find-links=file:dist parametric-plasma-source
- name: Run tests
run: |
python -m pip install -r requirements-develop.txt
cd tests
python -m pytest
publish:
runs-on: ubuntu-latest
needs: test
steps:
- name: Download build
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Publish wheel artifact to TestPyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m pip install twine
python3 -m twine upload --repository testpypi dist/* --verbose
- name: Release wheel artifact to PyPI
if: startsWith(github.ref, 'refs/tags')
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m twine upload dist/* --verbose