forked from delphix/virtualization-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (126 loc) · 4.54 KB
/
Copy pathpre-commit.yml
File metadata and controls
158 lines (126 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Pre-commit actions for Delphix Virtualization SDK
on: [pull_request]
jobs:
pytest27:
name: Test ${{ matrix.package }} on ${{ matrix.os }} using pytest (Python 2.7)
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
python-version: [2.7]
os: [ubuntu-latest, macos-latest, windows-latest]
package: [common, libs, platform]
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
pytest38:
name: Test ${{ matrix.package }} on ${{ matrix.os }} using pytest (Python 3.8)
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
python-version: [3.8]
os: [ubuntu-latest, macos-latest, windows-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
lintpython27:
name: Lint ${{ matrix.package }} - Python27
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
package: [common, libs, platform]
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 src/test/python --max-line-length 88
lintpython38:
name: Lint ${{ matrix.package }} - Python38
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
package: [common, libs, platform, tools]
steps:
- name: Checkout ${{ matrix.package }}
uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- 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 src/test/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/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"