-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Migrate CI tests to Github Actions #2936
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
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ed761db
Create and test pysyft package on various Pythons
karlhigley 0b2f14a
Rework build script to run tests like Travis
karlhigley 85c8dc3
Update Python versions to 3.6+
karlhigley 5b84e78
Remove Python 3.8 since Torch doesn't support it
karlhigley 414683a
Only run the tutorial translation tests when the tutorials change
karlhigley 96d30f1
Measure process time instead of wall time in efficiency tests
karlhigley 9375d3d
Increase `max_time` for `test_inv_sym` closer to original value
karlhigley 9596572
Rework "test all notebooks" tests to split off translation tests
karlhigley a3aef8f
Create a separate section in the action logs for coverage reports
karlhigley 78d292b
Exclude translation tests from coverage checks
karlhigley 91d9712
Bump `test_inv_sym` execution time limit to 30
karlhigley 12d4485
Omit `.github` directory from code coverage checking
karlhigley a9e2729
Fix translation notebooks test to account for excluded notebooks
karlhigley 84db3eb
Move coverage exclusions into setup.cfg instead of .travis.yml
karlhigley a423b4f
Merge branch 'master' into package-testing-action
karlhigley 3a59a7e
Omit the efficiency tests from Github Action check suite
karlhigley a2233ef
Unwind changes to the efficiency tests (now skipped in check suite)
karlhigley c8f5ee6
Merge branch 'master' into package-testing-action
karlhigley b75981f
Stop using efficiency test time assertions outside the efficiency tests
karlhigley e20506d
Standardize the name of the efficiency tests module
karlhigley 7be058f
Fix efficiency assertion imports
karlhigley 44780cd
Fix a missing wildcard in the coverage omission flag
karlhigley 874e99d
Apply testing workflow to PR creation, synchronization, and reopening
karlhigley 587a80d
Clean up coverage check inclusions and exclusions
karlhigley 4000921
Fix triggering events section
karlhigley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: Run tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| max-parallel: 4 | ||
| matrix: | ||
| python-version: [3.6, 3.7] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| python -m pip install --upgrade pip | ||
| hash -r | ||
| pip3 install -r pip-dep/requirements.txt | ||
| pip3 install -r pip-dep/requirements_dev.txt | ||
| pip3 install -r pip-dep/requirements_udacity.txt | ||
| pip3 install -r pip-dep/requirements_notebooks.txt | ||
| pip3 install scikit-learn | ||
| python setup.py install | ||
| - name: Lint, format, and type-check | ||
| run: | | ||
| pip3 install flake8 | ||
| #- pip3 install flake8-docstrings | ||
| pip3 install flake8-comprehensions | ||
| pip3 install pep8-naming | ||
| # stop the build if there are Python syntax errors or undefined names | ||
| flake8 --config=.flake8 . | ||
| black --check --verbose . | ||
| # exit-zero treats all errors as warnings. | ||
| # diverting from the standard 79 character line length in | ||
| # accordance with this: | ||
| # https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds | ||
| flake8 . --count --exit-zero --statistics --select=E,F,W,C90 | ||
| # Run type checker in CI such that type errors can be identified and gradually addressed. | ||
| # Once all existing type errors are addressed, the `|| echo` after the mypy call can be removed. | ||
| mypy syft || echo "Type errors found, continuing build..." | ||
| - name: Test with pytest | ||
| run: | | ||
| coverage run -m pytest test --deselect=test/notebooks/test_notebooks.py::test_notebooks_basic_translations --deselect=test/notebooks/test_notebooks.py::test_all_translation_notebooks --deselect=test/efficiency | ||
| - name: Coverage reports | ||
| run: | | ||
| coverage report --ignore-errors --fail-under 95 -m | ||
| # ensuring coverage of tests stays at 100 until entire coverage can be 100 | ||
| coverage report --ignore-errors --fail-under 100 -m --include="test/*" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Run notebook translation tests | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - 'examples/tutorials/**' | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| max-parallel: 4 | ||
| matrix: | ||
| python-version: [3.6, 3.7] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| python -m pip install --upgrade pip | ||
| hash -r | ||
| pip3 install -r pip-dep/requirements.txt | ||
| pip3 install -r pip-dep/requirements_dev.txt | ||
| pip3 install -r pip-dep/requirements_udacity.txt | ||
| pip3 install -r pip-dep/requirements_notebooks.txt | ||
| pip3 install scikit-learn | ||
| python setup.py install | ||
| - name: Test with pytest | ||
| run: | | ||
| pytest test test/notebooks/test_notebooks.py::test_notebooks_basic_translations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...efficiency_tests/test_activations_time.py → test/efficiency/test_activations_time.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this will help to speed up things much, but what if we run linting tools before deps installation?
Turnaround for formatting errors would be faster, in theory :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might need to keep
pip3 install -r pip-dep/requirements_dev.txthoweverThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was considering running linting as a completely separate action, since the first failure will cancel other actions in progress. Let's leave that for a future issue/PR though?