forked from Netflix/metaflow
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (77 loc) · 2.46 KB
/
publish.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
name: Publish
on:
release:
types: [published]
jobs:
test:
name: tests / ${{ matrix.lang }} tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
lang: [Python, R]
steps:
- uses: actions/checkout@v2
- name: Set up Python 2.x
if: matrix.lang == 'Python'
uses: actions/setup-python@v2
with:
python-version: '2.x'
- name: Install Python 2.x dependencies
if: matrix.lang == 'Python'
run: |
python2 -m pip install --upgrade pip
python2 -m pip install tox
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install Python 3.x dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install tox numpy
- name: Set up R 4.1
if: matrix.lang == 'R'
uses: r-lib/actions/setup-r@v1
with:
r-version: '4.1.1'
- name: Install R 4.1 system dependencies
if: matrix.lang == 'R' && matrix.os == 'ubuntu-latest'
run: sudo apt-get update; sudo apt-get install -y libcurl4-openssl-dev qpdf libgit2-dev
- name: Install R 4.1 Rlang dependencies
if: matrix.lang == 'R'
run: |
python3 -m pip install .
Rscript -e 'install.packages("devtools", repos="https://cloud.r-project.org", Ncpus=8)'
Rscript -e 'devtools::install_deps("R", dependencies=TRUE, repos="https://cloud.r-project.org", upgrade="default")'
R CMD INSTALL R
Rscript -e 'install.packages(c("data.table", "caret", "glmnet", "Matrix", "rjson"), repos="https://cloud.r-project.org", Ncpus=8)'
- name: Execute R tests
if: matrix.lang == 'R'
run: |
cd R/tests
Rscript run_tests.R
- name: Execute Python tests
if: matrix.lang == 'python'
run: tox
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install Python 3.x dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install setuptools wheel twine
- name: Build package
run: |
python3 setup.py sdist bdist_wheel --universal
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}