-
Notifications
You must be signed in to change notification settings - Fork 29
82 lines (67 loc) · 2.75 KB
/
Copy pathpre-commit.yml
File metadata and controls
82 lines (67 loc) · 2.75 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
#
# Copyright (c) 2020, 2026 by Delphix. All rights reserved.
#
name: "Pre-commit actions for Delphix Virtualization SDK"
on:
# It is important to check the commits done to master, develop and release branches only.
pull_request:
branches:
- master
- develop
- release
jobs:
pytest311:
name: Test SDK on ${{ matrix.os }} (Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 3
matrix:
python-version: [ 3.11 ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Install all SDK packages once, in dependency order. Sibling packages
# need to be present in the env before subsequent installs can resolve
# their PEP 621 pins (e.g. dvp-libs needs dvp-common already installed).
- name: Install SDK packages
run: |
python -m pip install --upgrade pip
pip install -e "./common[dev]" --find-links https://test.pypi.org/simple/dvp-api/
pip install -e "./libs[dev]" --find-links https://test.pypi.org/simple/dvp-api/
pip install -e "./platform[dev]" --find-links https://test.pypi.org/simple/dvp-api/
pip install -e "./tools[dev]" --find-links https://test.pypi.org/simple/dvp-api/
- name: Test common
run: python -m pytest ./common/src/test/python
- name: Test libs
run: python -m pytest ./libs/src/test/python
- name: Test platform
run: python -m pytest ./platform/src/test/python
- name: Test tools
run: python -m pytest ./tools/src/test/python
- name: Install flake8
if: matrix.os == 'ubuntu-latest'
run: pip install flake8
- name: Lint common
if: matrix.os == 'ubuntu-latest'
run: |
python -m flake8 ./common/src/main/python --max-line-length 88
python -m flake8 ./common/src/test/python --max-line-length 88
- name: Lint libs
if: matrix.os == 'ubuntu-latest'
run: |
python -m flake8 ./libs/src/main/python --max-line-length 88
python -m flake8 ./libs/src/test/python --max-line-length 88
- name: Lint platform
if: matrix.os == 'ubuntu-latest'
run: |
python -m flake8 ./platform/src/main/python --max-line-length 88
python -m flake8 ./platform/src/test/python --max-line-length 88
- name: Lint tools
if: matrix.os == 'ubuntu-latest'
run: |
python -m flake8 ./tools/src/main/python --max-line-length 88
python -m flake8 ./tools/src/test/python --max-line-length 88