-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incorporate lib build for MacOS into CI (#36)
- Loading branch information
Showing
9 changed files
with
150 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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 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,66 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest] | ||
python-version: [3.5, 3.6, 3.7] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: actions/[email protected] | ||
id: cache-reqs | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-python-${{ matrix.python-version }}-pip-${{ hashFiles('requirements*.txt') }} | ||
- name: Install dependencies | ||
|
||
run: | | ||
if [ ${{ matrix.os }} == ubuntu-latest ] | ||
then | ||
sudo apt-get update | ||
python -m pip install --upgrade pip | ||
hash -r | ||
pip3 install -r requirements.txt | ||
pip3 install -r requirements_dev.txt | ||
python3 setup.py install | ||
elif [ ${{ matrix.os }} == macos-latest ] | ||
then | ||
brew update | ||
python -m pip install --upgrade pip | ||
hash -r | ||
pip3 install -r requirements.txt | ||
pip3 install -r requirements_dev.txt | ||
python3 setup.py install | ||
else | ||
exit 1 | ||
fi | ||
shell: bash | ||
- name: Lint, format, and type-check | ||
run: | | ||
pip3 install flake8 | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Scan for security issues | ||
run: | | ||
bandit -r syft -ll | ||
- name: Run tests | ||
run: | | ||
coverage run -m pytest test |
This file contains 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 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 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import torch | ||
|
||
def sum(x,y): | ||
|
||
return torch.add(x, y) | ||
|
||
def sum(x, y): | ||
|
||
return torch.add(x, y) |
This file contains 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 |
---|---|---|
|
@@ -2,3 +2,4 @@ pytest>=4.5.0 | |
bandit | ||
coverage>=4.5.3 | ||
pre-commit | ||
flake8 |
This file contains 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 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