Skip to content

Update workflow files #363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,61 @@
name: dist-check

on: [push, pull_request]
on:
# Manually triggerable in github
workflow_dispatch:

# When a push occurs on either of these branches
push:
branches:
- master
- development

# When a push occurs on a PR that targets these branches
pull_request:
branches:
- master
- development

schedule:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually why would you like this workflow on a schedule?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no real need, there's also no real need to have it on anything but push to master or development. This workflow actually does very little compared to pytest.yaml, which is also build a dist version and then runs tests on it. The only difference here is that it runs twine check which checks that the long description will parse correctly on PyPi, that's it.

I would probably remove this workflow entirely upon second though.

Copy link
Contributor Author

@eddiebergman eddiebergman Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, upon looking deeper, I think the mypy compliance thing is wrong, I originally submitted a PR to autosklearn before joining the group, which checks for the PEP compliance. I think it got lost in translation to the workflow files in all our repos. It should be mypy -c "import autoPyTorch"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the compliance check

# Every day at 7AM UTC
- cron: '0 07 * * *'

jobs:

dist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Build dist
run: |
python setup.py sdist

- name: Twine check
run: |
pip install twine
last_dist=$(ls -t dist/autoPyTorch-*.tar.gz | head -n 1)
twine_output=`twine check "$last_dist"`
if [[ "$twine_output" != "Checking $last_dist: PASSED" ]]; then echo $twine_output && exit 1;fi

- name: Install dist
run: |
last_dist=$(ls -t dist/autoPyTorch-*.tar.gz | head -n 1)
pip install $last_dist

- name: PEP 561 Compliance
run: |
pip install mypy
cd .. # required to use the installed version of autosklearn
if ! python -c "import autoPyTorch"; then exit 1; fi

cd .. # required to use the installed version of autoPyTorch

# Note this doesn't perform mypy checks, those are handled in pre-commit.yaml
# This only checks if autoPyTorch exports type information
if ! mypy -c "import autoPyTorch"; then exit 1; fi
28 changes: 26 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,59 @@
name: Docs
on: [pull_request, push]

on:
# Allow to manually trigger through github API
# Wont trigger the push to github pages where the documentation is located
workflow_dispatch:

# Triggers with push to these branches
push:
branches:
- master
- development

# Triggers with push to a pr aimed at these branches
pull_request:
branches:
- master
- development

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
git submodule update --init --recursive
pip install -e .[docs,examples]

- name: Make docs
run: |
cd docs
make html

- name: Pull latest gh-pages
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
run: |
cd ..
git clone https://github.com/automl/Auto-PyTorch.git --branch gh-pages --single-branch gh-pages

- name: Copy new doc into gh-pages
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
run: |
branch_name=${GITHUB_REF##*/}
cd ../gh-pages
rm -rf $branch_name
cp -r ../Auto-PyTorch/docs/build/html $branch_name

- name: Push to gh-pages
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
run: |
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/long_regression_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,32 @@ on:
#- cron: '0 07 * * 2'
- cron: '0 07 * * *'


jobs:
ubuntu:

ubuntu:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: [3.8]
fail-fast: false

steps:
- uses: actions/checkout@v2
with:
ref: development

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install test dependencies
run: |
git submodule update --init --recursive
python -m pip install --upgrade pip
pip install -e .[test]

- name: Run tests
run: |
python -m pytest --durations=200 cicd/test_preselected_configs.py -vs
25 changes: 23 additions & 2 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
name: pre-commit

on: [push, pull_request]
on:
# Allow to manually trigger through github API
workflow_dispatch:

# Triggers with push to these branches
push:
branches:
- master
- development

# Triggers with push to a pr aimed at these branches
pull_request:
branches:
- master
- development

jobs:

run-all-files:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Init Submodules
run: |
git submodule update --init --recursive

- name: Install pre-commit
run: |
pip install pre-commit
pre-commit install

- name: Run pre-commit
run: |
pre-commit run --all-files
99 changes: 88 additions & 11 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,117 @@
name: Tests

on: [push, pull_request]
on:
# Allow to manually trigger through github API
workflow_dispatch:

# Triggers with push to these branches
push:
branches:
- master
- development

# Triggers with push to pr targeting these branches
pull_request:
branches:
- master
- development

schedule:
# Every day at 7AM UTC
- cron: '0 07 * * *'

env:

# Arguments used for pytest
pytest-args: >-
--forked
--durations=20
--timeout=600
--timeout-method=signal
-v

# Arguments used for code-cov which is later used to annotate PR's on github
code-cov-args: >-
--cov=autoPyTorch
--cov-report=xml
--cov-config=.coveragerc

jobs:
ubuntu:
tests:

name: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.kind }}
runs-on: ${{ matrix.os }}

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
os: [windows-latest, macos-latest, ubuntu-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
kind: ['source', 'dist']

exclude:
# Exclude all configurations *-*-dist, include one later
- kind: 'dist'

# Exclude windows as bash commands wont work in windows runner
- os: windows-latest

# Exclude macos as there are permission errors using conda as we do
- os: macos-latest

# Exclude python 3.10 as torch is not support python 3.10 yet
- python-version: '3.10'

include:
- python-version: 3.8
# Add the tag code-cov to ubuntu-3.7-source
- os: ubuntu-latest
python-version: 3.7
kind: 'source'
code-cov: true
fail-fast: false
max-parallel: 2

# Include one config with dist, ubuntu-3.7-dist
- os: ubuntu-latest
python-version: 3.7
kind: 'dist'

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies

- name: Source install
if: matrix.kind == 'source'
run: |
git submodule update --init --recursive
python -m pip install --upgrade pip
pip install -e .[test]

- name: Dist install
if: matrix.kind == 'dist'
run: |
git submodule update --init --recursive

python setup.py sdist
last_dist=$(ls -t dist/autoPyTorch-*.tar.gz | head -n 1)
pip install $last_dist[test]

- name: Store repository status
id: status-before
run: |
echo "::set-output name=BEFORE::$(git status --porcelain -b)"

- name: Run tests
run: |
if [ ${{ matrix.code-cov }} ]; then
codecov='--cov=autoPyTorch --cov-report=xml --cov-config=.coveragerc';
python -m pytest ${{ env.pytest-args }} ${{ env.code-cov-args }} test
else
python -m pytest ${{ env.pytest-args }} test
fi
python -m pytest --forked --durations=20 --timeout=600 --timeout-method=signal -v $codecov test

- name: Check for files left behind by test
if: ${{ always() }}
run: |
Expand All @@ -47,6 +123,7 @@ jobs:
echo "Not all generated files have been deleted!"
exit 1
fi

- name: Upload coverage
if: matrix.code-cov && always()
uses: codecov/codecov-action@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master

jobs:
test:
publish:
runs-on: "ubuntu-latest"

steps:
Expand All @@ -30,4 +30,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_token }}
password: ${{ secrets.pypi_token }}
Loading