Skip to content

Commit 23f6e83

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 <13005107+ravinkohli@users.noreply.github.com> Co-authored-by: Ravin Kohli <13005107+ravinkohli@users.noreply.github.com>
1 parent 40a3987 commit 23f6e83

File tree

10 files changed

+182
-58
lines changed

10 files changed

+182
-58
lines changed

.github/workflows/dist.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,61 @@
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
31+
1032
- name: Setup Python
1133
uses: actions/setup-python@v2
1234
with:
1335
python-version: 3.8
36+
1437
- name: Build dist
1538
run: |
1639
python setup.py sdist
40+
1741
- name: Twine check
1842
run: |
1943
pip install twine
2044
last_dist=$(ls -t dist/autoPyTorch-*.tar.gz | head -n 1)
2145
twine_output=`twine check "$last_dist"`
2246
if [[ "$twine_output" != "Checking $last_dist: PASSED" ]]; then echo $twine_output && exit 1;fi
47+
2348
- name: Install dist
2449
run: |
2550
last_dist=$(ls -t dist/autoPyTorch-*.tar.gz | head -n 1)
2651
pip install $last_dist
52+
2753
- name: PEP 561 Compliance
2854
run: |
2955
pip install mypy
30-
cd .. # required to use the installed version of autosklearn
31-
if ! python -c "import autoPyTorch"; then exit 1; fi
56+
57+
cd .. # required to use the installed version of autoPyTorch
58+
59+
# Note this doesn't perform mypy checks, those are handled in pre-commit.yaml
60+
# This only checks if autoPyTorch exports type information
61+
if ! mypy -c "import autoPyTorch"; then exit 1; fi

.github/workflows/docs.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +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
27+
928
- name: Setup Python
1029
uses: actions/setup-python@v2
1130
with:
1231
python-version: 3.8
32+
1333
- name: Install dependencies
1434
run: |
1535
git submodule update --init --recursive
1636
pip install -e .[docs,examples]
37+
1738
- name: Make docs
1839
run: |
1940
cd docs
2041
make html
42+
2143
- name: Pull latest gh-pages
2244
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
2345
run: |
2446
cd ..
2547
git clone https://github.com/automl/Auto-PyTorch.git --branch gh-pages --single-branch gh-pages
48+
2649
- name: Copy new doc into gh-pages
2750
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
2851
run: |
2952
branch_name=${GITHUB_REF##*/}
3053
cd ../gh-pages
3154
rm -rf $branch_name
3255
cp -r ../Auto-PyTorch/docs/build/html $branch_name
56+
3357
- name: Push to gh-pages
3458
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
3559
run: |

.github/workflows/long_regression_test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,32 @@ 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
2222
with:
2323
ref: development
24+
2425
- name: Setup Python ${{ matrix.python-version }}
2526
uses: actions/setup-python@v2
2627
with:
2728
python-version: ${{ matrix.python-version }}
29+
2830
- name: Install test dependencies
2931
run: |
3032
git submodule update --init --recursive
3133
python -m pip install --upgrade pip
3234
pip install -e .[test]
35+
3336
- name: Run tests
3437
run: |
3538
python -m pytest --durations=200 cicd/test_preselected_configs.py -vs

.github/workflows/pre-commit.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +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
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
1028
- name: Setup Python 3.7
1129
uses: actions/setup-python@v2
1230
with:
1331
python-version: 3.7
32+
1433
- name: Init Submodules
1534
run: |
1635
git submodule update --init --recursive
36+
1737
- name: Install pre-commit
1838
run: |
1939
pip install pre-commit
2040
pre-commit install
41+
2142
- name: Run pre-commit
2243
run: |
2344
pre-commit run --all-files

.github/workflows/pytest.yml

Lines changed: 88 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,117 @@
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
78+
- name: Checkout
79+
uses: actions/checkout@v2
80+
2081
- name: Setup Python ${{ matrix.python-version }}
2182
uses: actions/setup-python@v2
2283
with:
2384
python-version: ${{ matrix.python-version }}
24-
- name: Install test dependencies
85+
86+
- name: Source install
87+
if: matrix.kind == 'source'
2588
run: |
2689
git submodule update --init --recursive
2790
python -m pip install --upgrade pip
2891
pip install -e .[test]
92+
93+
- name: Dist install
94+
if: matrix.kind == 'dist'
95+
run: |
96+
git submodule update --init --recursive
97+
98+
python setup.py sdist
99+
last_dist=$(ls -t dist/autoPyTorch-*.tar.gz | head -n 1)
100+
pip install $last_dist[test]
101+
29102
- name: Store repository status
30103
id: status-before
31104
run: |
32105
echo "::set-output name=BEFORE::$(git status --porcelain -b)"
106+
33107
- name: Run tests
34108
run: |
35109
if [ ${{ matrix.code-cov }} ]; then
36-
codecov='--cov=autoPyTorch --cov-report=xml --cov-config=.coveragerc';
110+
python -m pytest ${{ env.pytest-args }} ${{ env.code-cov-args }} test
111+
else
112+
python -m pytest ${{ env.pytest-args }} test
37113
fi
38-
python -m pytest --forked --durations=20 --timeout=600 --timeout-method=signal -v $codecov test
114+
39115
- name: Check for files left behind by test
40116
if: ${{ always() }}
41117
run: |
@@ -47,6 +123,7 @@ jobs:
47123
echo "Not all generated files have been deleted!"
48124
exit 1
49125
fi
126+
50127
- name: Upload coverage
51128
if: matrix.code-cov && always()
52129
uses: codecov/codecov-action@v1

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- master
77

88
jobs:
9-
test:
9+
publish:
1010
runs-on: "ubuntu-latest"
1111

1212
steps:
@@ -30,4 +30,4 @@ jobs:
3030
uses: pypa/gh-action-pypi-publish@master
3131
with:
3232
user: __token__
33-
password: ${{ secrets.pypi_token }}
33+
password: ${{ secrets.pypi_token }}

0 commit comments

Comments
 (0)