Skip to content

Commit aa927a3

Browse files
Update workflow files (#363)
* update workflow files * Remove double quotes * Exclude python 3.10 * Fix mypy compliance check * Added PEP 561 compliance * Add py.typed to MANIFEST for dist * Update .github/workflows/dist.yml Co-authored-by: Ravin Kohli <[email protected]> Co-authored-by: Ravin Kohli <[email protected]>
1 parent fd001a6 commit aa927a3

File tree

10 files changed

+182
-63
lines changed

10 files changed

+182
-63
lines changed

.github/workflows/dist.yml

+33-4
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,62 @@
11
name: dist-check
22

3-
on: [push, pull_request]
3+
on:
4+
# Manually triggerable in github
5+
workflow_dispatch:
6+
7+
# When a push occurs on either of these branches
8+
push:
9+
branches:
10+
- master
11+
- development
12+
13+
# When a push occurs on a PR that targets these branches
14+
pull_request:
15+
branches:
16+
- master
17+
- development
18+
19+
schedule:
20+
# Every day at 7AM UTC
21+
- cron: '0 07 * * *'
422

523
jobs:
24+
625
dist:
726
runs-on: ubuntu-latest
27+
828
steps:
9-
- uses: actions/checkout@v2
29+
- name: Checkout
30+
uses: actions/checkout@v2
1031
with:
1132
submodules: recursive
1233
- name: Setup Python
1334
uses: actions/setup-python@v2
1435
with:
1536
python-version: 3.8
37+
1638
- name: Build dist
1739
run: |
1840
python setup.py sdist
41+
1942
- name: Twine check
2043
run: |
2144
pip install twine
2245
last_dist=$(ls -t dist/autoPyTorch-*.tar.gz | head -n 1)
2346
twine_output=`twine check "$last_dist"`
2447
if [[ "$twine_output" != "Checking $last_dist: PASSED" ]]; then echo $twine_output && exit 1;fi
48+
2549
- name: Install dist
2650
run: |
2751
last_dist=$(ls -t dist/autoPyTorch-*.tar.gz | head -n 1)
2852
pip install $last_dist
53+
2954
- name: PEP 561 Compliance
3055
run: |
3156
pip install mypy
32-
cd .. # required to use the installed version of autosklearn
33-
if ! python -c "import autoPyTorch"; then exit 1; fi
57+
58+
cd .. # required to use the installed version of autoPyTorch
59+
60+
# Note this doesn't perform mypy checks, those are handled in pre-commit.yaml
61+
# This only checks if autoPyTorch exports type information
62+
if ! mypy -c "import autoPyTorch"; then exit 1; fi

.github/workflows/docs.yml

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,59 @@
11
name: Docs
2-
on: [pull_request, push]
2+
3+
on:
4+
# Allow to manually trigger through github API
5+
# Wont trigger the push to github pages where the documentation is located
6+
workflow_dispatch:
7+
8+
# Triggers with push to these branches
9+
push:
10+
branches:
11+
- master
12+
- development
13+
14+
# Triggers with push to a pr aimed at these branches
15+
pull_request:
16+
branches:
17+
- master
18+
- development
319

420
jobs:
521
build-and-deploy:
622
runs-on: ubuntu-latest
23+
724
steps:
8-
- uses: actions/checkout@v2
25+
- name: Checkout
26+
uses: actions/checkout@v2
927
with:
1028
submodules: recursive
1129
- name: Setup Python
1230
uses: actions/setup-python@v2
1331
with:
1432
python-version: 3.8
33+
1534
- name: Install dependencies
1635
run: |
1736
pip install -e .[docs,examples]
37+
1838
- name: Make docs
1939
run: |
2040
cd docs
2141
make html
42+
2243
- name: Pull latest gh-pages
2344
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
2445
run: |
2546
cd ..
2647
git clone https://github.com./automl/Auto-PyTorch.git --branch gh-pages --single-branch gh-pages
48+
2749
- name: Copy new doc into gh-pages
2850
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
2951
run: |
3052
branch_name=${GITHUB_REF##*/}
3153
cd ../gh-pages
3254
rm -rf $branch_name
3355
cp -r ../Auto-PyTorch/docs/build/html $branch_name
56+
3457
- name: Push to gh-pages
3558
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
3659
run: |

.github/workflows/long_regression_test.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ on:
77
#- cron: '0 07 * * 2'
88
- cron: '0 07 * * *'
99

10-
1110
jobs:
12-
ubuntu:
1311

12+
ubuntu:
1413
runs-on: ubuntu-latest
14+
1515
strategy:
16+
fail-fast: false
1617
matrix:
1718
python-version: [3.8]
18-
fail-fast: false
1919

2020
steps:
2121
- uses: actions/checkout@v2
@@ -26,10 +26,12 @@ jobs:
2626
uses: actions/setup-python@v2
2727
with:
2828
python-version: ${{ matrix.python-version }}
29+
2930
- name: Install test dependencies
3031
run: |
3132
python -m pip install --upgrade pip
3233
pip install -e .[test]
34+
3335
- name: Run tests
3436
run: |
3537
python -m pytest --durations=200 cicd/test_preselected_configs.py -vs

.github/workflows/pre-commit.yaml

+26-4
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,44 @@
11
name: pre-commit
22

3-
on: [push, pull_request]
3+
on:
4+
# Allow to manually trigger through github API
5+
workflow_dispatch:
6+
7+
# Triggers with push to these branches
8+
push:
9+
branches:
10+
- master
11+
- development
12+
13+
# Triggers with push to a pr aimed at these branches
14+
pull_request:
15+
branches:
16+
- master
17+
- development
418

519
jobs:
20+
621
run-all-files:
722
runs-on: ubuntu-latest
23+
824
steps:
9-
- uses: actions/checkout@v2
10-
with:
11-
submodules: recursive
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
1228
- name: Setup Python 3.7
1329
uses: actions/setup-python@v2
1430
with:
1531
python-version: 3.7
32+
33+
- name: Init Submodules
34+
run: |
35+
git submodule update --init --recursive
36+
1637
- name: Install pre-commit
1738
run: |
1839
pip install pre-commit
1940
pre-commit install
41+
2042
- name: Run pre-commit
2143
run: |
2244
pre-commit run --all-files

.github/workflows/pytest.yml

+88-13
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,116 @@
11
name: Tests
22

3-
on: [push, pull_request]
3+
on:
4+
# Allow to manually trigger through github API
5+
workflow_dispatch:
6+
7+
# Triggers with push to these branches
8+
push:
9+
branches:
10+
- master
11+
- development
12+
13+
# Triggers with push to pr targeting these branches
14+
pull_request:
15+
branches:
16+
- master
17+
- development
18+
19+
schedule:
20+
# Every day at 7AM UTC
21+
- cron: '0 07 * * *'
22+
23+
env:
24+
25+
# Arguments used for pytest
26+
pytest-args: >-
27+
--forked
28+
--durations=20
29+
--timeout=600
30+
--timeout-method=signal
31+
-v
32+
33+
# Arguments used for code-cov which is later used to annotate PR's on github
34+
code-cov-args: >-
35+
--cov=autoPyTorch
36+
--cov-report=xml
37+
--cov-config=.coveragerc
438
539
jobs:
6-
ubuntu:
40+
tests:
41+
42+
name: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.kind }}
43+
runs-on: ${{ matrix.os }}
744

8-
runs-on: ubuntu-latest
945
strategy:
46+
fail-fast: false
1047
matrix:
11-
python-version: [3.7, 3.8, 3.9]
48+
os: [windows-latest, macos-latest, ubuntu-latest]
49+
python-version: ['3.7', '3.8', '3.9', '3.10']
50+
kind: ['source', 'dist']
51+
52+
exclude:
53+
# Exclude all configurations *-*-dist, include one later
54+
- kind: 'dist'
55+
56+
# Exclude windows as bash commands wont work in windows runner
57+
- os: windows-latest
58+
59+
# Exclude macos as there are permission errors using conda as we do
60+
- os: macos-latest
61+
62+
# Exclude python 3.10 as torch is not support python 3.10 yet
63+
- python-version: '3.10'
64+
1265
include:
13-
- python-version: 3.8
66+
# Add the tag code-cov to ubuntu-3.7-source
67+
- os: ubuntu-latest
68+
python-version: 3.7
69+
kind: 'source'
1470
code-cov: true
15-
fail-fast: false
16-
max-parallel: 2
71+
72+
# Include one config with dist, ubuntu-3.7-dist
73+
- os: ubuntu-latest
74+
python-version: 3.7
75+
kind: 'dist'
1776

1877
steps:
19-
- uses: actions/checkout@v2
20-
with:
21-
submodules: recursive
78+
- name: Checkout
79+
uses: actions/checkout@v2
80+
2281
- name: Setup Python ${{ matrix.python-version }}
2382
uses: actions/setup-python@v2
2483
with:
2584
python-version: ${{ matrix.python-version }}
26-
- name: Install test dependencies
85+
86+
- name: Source install
87+
if: matrix.kind == 'source'
2788
run: |
2889
python -m pip install --upgrade pip
2990
pip install -e .[test]
91+
92+
- name: Dist install
93+
if: matrix.kind == 'dist'
94+
run: |
95+
git submodule update --init --recursive
96+
97+
python setup.py sdist
98+
last_dist=$(ls -t dist/autoPyTorch-*.tar.gz | head -n 1)
99+
pip install $last_dist[test]
100+
30101
- name: Store repository status
31102
id: status-before
32103
run: |
33104
echo "::set-output name=BEFORE::$(git status --porcelain -b)"
105+
34106
- name: Run tests
35107
run: |
36108
if [ ${{ matrix.code-cov }} ]; then
37-
codecov='--cov=autoPyTorch --cov-report=xml --cov-config=.coveragerc';
109+
python -m pytest ${{ env.pytest-args }} ${{ env.code-cov-args }} test
110+
else
111+
python -m pytest ${{ env.pytest-args }} test
38112
fi
39-
python -m pytest --forked --durations=20 --timeout=600 --timeout-method=signal -v $codecov test
113+
40114
- name: Check for files left behind by test
41115
if: ${{ always() }}
42116
run: |
@@ -48,6 +122,7 @@ jobs:
48122
echo "Not all generated files have been deleted!"
49123
exit 1
50124
fi
125+
51126
- name: Upload coverage
52127
if: matrix.code-cov && always()
53128
uses: codecov/codecov-action@v1

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
build-n-publish:
11+
publish:
1212
runs-on: "ubuntu-latest"
1313

1414
steps:
@@ -50,4 +50,4 @@ jobs:
5050
uses: pypa/gh-action-pypi-publish@master
5151
with:
5252
user: __token__
53-
password: ${{ secrets.PYPI_TOKEN }}
53+
password: ${{ secrets.pypi_token }}

0 commit comments

Comments
 (0)