forked from scikit-hep/coffea
-
Notifications
You must be signed in to change notification settings - Fork 0
190 lines (176 loc) · 5.47 KB
/
ci.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: CI/CD
on:
push:
branches:
- master
- backports-v0.6.x
tags:
- v*.*.*
pull_request:
branches:
- master
- backports-v0.6.x
# Run daily at 0:01 UTC
schedule:
- cron: '1 0 * * *'
jobs:
linter:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
name: linter - flake8/black - python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Lint with flake8 and black
run: |
python -m pip install -q flake8 black
flake8 coffea tests setup.py
black --check --diff coffea tests setup.py
test:
runs-on: ${{ matrix.os }}
needs: linter
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
java-version: [1.8]
python-version: ["3.6", "3.9"]
exclude:
- os: macOS-latest
python-version: 3.6
name: test coffea (${{ matrix.os }}) - python ${{ matrix.python-version }}, JDK${{ matrix.java-version }}
steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up JDK ${{ matrix.java-version }}
if: matrix.os != 'windows-latest'
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
- name: Set python 3.6 test settings
run: |
echo "INSTALL_EXTRAS=[dev,parsl,dask,spark]" >> $GITHUB_ENV
if: matrix.python-version == 3.6
- name: Set python newer than 3.6 test settings
run: |
echo "INSTALL_EXTRAS=[dev,parsl,dask,spark,servicex]" >> $GITHUB_ENV
if: matrix.python-version != 3.6
- name: Install dependencies (Linux/MacOS)
if: matrix.os != 'windows-latest'
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -q -e .${{env.INSTALL_EXTRAS}}
python -m pip list
java -version
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -q -e .[dev]
python -m pip list
- name: Test with pytest
env:
ARROW_PRE_0_15_IPC_FORMAT: 1
run: |
pytest --cov-report=xml --cov=coffea tests
- name: Upload codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.7
run: |
python -m pip install codecov
codecov
- name: Install graphviz
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.7
uses: kamiazya/setup-graphviz@v1
- name: Install pandoc
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.7
uses: r-lib/actions/setup-pandoc@v1
- name: Build documentation
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.7
run: |
cd docs && make html
touch build/html/.nojekyll
- name: Deploy documentation
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.python-version == 3.7
uses: crazy-max/[email protected]
with:
target_branch: gh-pages
build_dir: docs/build/html
env:
GITHUB_PAT: ${{ secrets.GITHUB_OAUTH }}
testwq:
runs-on: ubuntu-latest
needs: linter
name: test coffea-workqueue
steps:
- uses: actions/checkout@master
- name: Set up Conda
uses: conda-incubator/[email protected]
with:
auto-update-conda: true
python-version: 3.7
- name: Test work_queue
shell: bash -l {0}
run: |
conda create --name coffea-env python=3.7
conda activate coffea-env
conda install -c conda-forge ndcctools dill
python -m pip install .
cd tests
python wq.py
testskyhookjob:
runs-on: ubuntu-latest
needs: linter
name: test coffea-skyhook-job
steps:
- uses: actions/checkout@master
- name: Test Coffea Skyhook Bindings
shell: bash -l {0}
run: |
docker build -t coffea-skyhook-test \
--file docker/skyhook/Dockerfile \
.
docker run \
-v $(pwd):/w \
-w /w \
-e IS_CI=true \
--privileged \
coffea-skyhook-test \
./docker/skyhook/script.sh
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [test, testwq, testskyhookjob]
strategy:
matrix:
python-version: [3.9]
name: deploy release
steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Build package for PyPI
run: |
python -m pip install --upgrade pip setuptools wheel
python setup.py sdist bdist_wheel --universal
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_OAUTH }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}