forked from delphix/virtualization-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes PYT-900 : Initial migration: Write pre commit action (#4)
Github Action for pre-commit validations on the Delphix Virtualization SDK repo.
- Loading branch information
1 parent
01c3404
commit 2c73c64
Showing
6 changed files
with
97 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Pre-commit actions for Delphix Virtualization SDK | ||
|
||
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] | ||
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 --find-links https://test.pypi.org/simple/dvp-api/ | ||
- name: Install ${{ matrix.package }} project | ||
working-directory: ${{ matrix.package }} | ||
run: | | ||
pip install . --find-links https://test.pypi.org/simple/dvp-api/ | ||
- name: Test ${{ matrix.package }} project with pytest | ||
working-directory: ${{ matrix.package }} | ||
run: | | ||
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: | ||
#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/[email protected] | ||
#with: | ||
#args: "${{ matrix.package }}/src/main/python -t py27 --check" | ||
|
||
#- name: Check test format | ||
#uses: lgeiger/[email protected] | ||
#with: | ||
#args: "${{ matrix.package }}/src/test/python -t py27 --check" |
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
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