Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
93 changes: 93 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Pre-commit actions for Delphix Virtualization Platform SDK
Comment thread
muralinimmagadda marked this conversation as resolved.
Outdated

on: [pull_request]

jobs:
pytest:
name: Test ${{ matrix.package }} on ${{ matrix.os }} using pytest
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
python-version: [2.7]
os: [ubuntu-latest, macos-latest]
Comment thread
muralinimmagadda marked this conversation as resolved.
package: [common, libs, platform, tools]

steps:
- name: Checkout ${{ matrix.package }} project
uses: actions/checkout@v1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install ${{ matrix.package }} dependencies
working-directory: ${{ matrix.package }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt --index-url https://pypi.org/simple --extra-index-url https://test.pypi.org/simple
Comment thread
muralinimmagadda marked this conversation as resolved.
Outdated

- name: Install ${{ matrix.package }} project in editable mode
working-directory: ${{ matrix.package }}
run: |
pip install -e . --index-url https://pypi.org/simple --extra-index-url https://test.pypi.org/simple
Comment thread
muralinimmagadda marked this conversation as resolved.
Outdated

- name: Test ${{ matrix.package }} project with pytest
working-directory: ${{ matrix.package }}
run: |
pip install pytest
Comment thread
muralinimmagadda marked this conversation as resolved.
Outdated
python -m pytest src/test/python

lint:
name: Lint ${{ matrix.package }}

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
package: [tools]

steps:
- name: Checkout ${{ matrix.package }}
uses: actions/checkout@v1

- name: Set up Python 2.7
uses: actions/setup-python@v1
with:
python-version: 2.7

- name: Install flake8
run: |
python -m pip install --upgrade pip
pip install flake8

- name: Run flake8 on src directory
working-directory: ${{ matrix.package }}
run: python -m flake8 src/main/python --max-line-length 88

- name: Run flake8 on test directory
working-directory: ${{ matrix.package }}
run: python -m flake8 test/main/python --max-line-length 88

#format:
Comment thread
muralinimmagadda marked this conversation as resolved.
#name: Check format ${{ matrix.package}}

#runs-on: ubuntu-latest
#strategy:
#max-parallel: 4
#matrix:
#package: [common, libs, platform, tools]

#steps:
#- uses: actions/checkout@v1

#- name: Check src format
#uses: lgeiger/black-action@v1.0.1
#with:
#args: "${{ matrix.package }}/src/main/python -t py27 --check"

#- name: Check test format
#uses: lgeiger/black-action@v1.0.1
#with:
#args: "${{ matrix.package }}/src/test/python -t py27 --check"
2 changes: 1 addition & 1 deletion common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
PYTHON_SRC = 'src/main/python'

install_requires = [
"dvp-api == 1.1.0-master-003",
"dvp-api == 1.1.0.dev3",
]

with open(os.path.join(PYTHON_SRC, 'dlpx/virtualization/common/VERSION')) as version_file:
Expand Down
2 changes: 1 addition & 1 deletion libs/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
version = version_file.read().strip()

install_requires = [
"dvp-api == 1.1.0-master-003",
"dvp-api == 1.1.0.dev3",
"dvp-common == {}".format(version)
]

Expand Down
2 changes: 1 addition & 1 deletion platform/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
version = version_file.read().strip()

install_requires = [
"dvp-api == 1.1.0-master-003",
"dvp-api == 1.1.0.dev3",
"dvp-common == {}".format(version),
"enum34;python_version < '3.4'",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def virtual_source(connection, mount):
virtual_source.guid = TEST_GUID
virtual_source.connection.CopyFrom(connection)
virtual_source.parameters.json = TEST_VIRTUAL_SOURCE_JSON
virtual_source.mounts.MergeFrom([mount])
virtual_source.mounts.extend([mount])
return virtual_source

@staticmethod
Expand Down