Skip to content

Commit 4bdce98

Browse files
datapythonistajreback
authored andcommitted
CI: GitHub action for checks (linting, docstrings...) (#29546)
1 parent 698522f commit 4bdce98

File tree

2 files changed

+103
-21
lines changed

2 files changed

+103
-21
lines changed

.github/workflows/activate.yml

-21
This file was deleted.

.github/workflows/ci.yml

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: master
6+
pull_request:
7+
branches: master
8+
9+
env:
10+
ENV_FILE: environment.yml
11+
# TODO: remove export PATH=... in each step once this works
12+
# PATH: $HOME/miniconda3/bin:$PATH
13+
14+
jobs:
15+
checks:
16+
name: Checks
17+
runs-on: ubuntu-latest
18+
steps:
19+
20+
- name: Checkout
21+
uses: actions/checkout@v1
22+
23+
- name: Looking for unwanted patterns
24+
run: ci/code_checks.sh patterns
25+
if: true
26+
27+
- name: Setup environment and build pandas
28+
run: |
29+
export PATH=$HOME/miniconda3/bin:$PATH
30+
ci/setup_env.sh
31+
if: true
32+
33+
- name: Linting
34+
run: |
35+
export PATH=$HOME/miniconda3/bin:$PATH
36+
source activate pandas-dev
37+
ci/code_checks.sh lint
38+
if: true
39+
40+
- name: Dependencies consistency
41+
run: |
42+
export PATH=$HOME/miniconda3/bin:$PATH
43+
source activate pandas-dev
44+
ci/code_checks.sh dependencies
45+
if: true
46+
47+
- name: Checks on imported code
48+
run: |
49+
export PATH=$HOME/miniconda3/bin:$PATH
50+
source activate pandas-dev
51+
ci/code_checks.sh code
52+
if: true
53+
54+
- name: Running doctests
55+
run: |
56+
export PATH=$HOME/miniconda3/bin:$PATH
57+
source activate pandas-dev
58+
ci/code_checks.sh doctests
59+
if: true
60+
61+
- name: Docstring validation
62+
run: |
63+
export PATH=$HOME/miniconda3/bin:$PATH
64+
source activate pandas-dev
65+
ci/code_checks.sh docstrings
66+
if: true
67+
68+
- name: Typing validation
69+
run: |
70+
export PATH=$HOME/miniconda3/bin:$PATH
71+
source activate pandas-dev
72+
ci/code_checks.sh typing
73+
if: true
74+
75+
- name: Testing docstring validation script
76+
run: |
77+
export PATH=$HOME/miniconda3/bin:$PATH
78+
source activate pandas-dev
79+
pytest --capture=no --strict scripts
80+
if: true
81+
82+
- name: Running benchmarks
83+
run: |
84+
export PATH=$HOME/miniconda3/bin:$PATH
85+
source activate pandas-dev
86+
cd asv_bench
87+
asv check -E existing
88+
git remote add upstream https://github.com/pandas-dev/pandas.git
89+
git fetch upstream
90+
if git diff upstream/master --name-only | grep -q "^asv_bench/"; then
91+
asv machine --yes
92+
ASV_OUTPUT="$(asv dev)"
93+
if [[ $(echo "$ASV_OUTPUT" | grep "failed") ]]; then
94+
echo "##vso[task.logissue type=error]Benchmarks run with errors"
95+
echo "$ASV_OUTPUT"
96+
exit 1
97+
else
98+
echo "Benchmarks run without errors"
99+
fi
100+
else
101+
echo "Benchmarks did not run, no changes detected"
102+
fi
103+
if: true

0 commit comments

Comments
 (0)