forked from datacommonsorg/data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.py.yaml
More file actions
62 lines (55 loc) · 2.09 KB
/
Copy pathcloudbuild.py.yaml
File metadata and controls
62 lines (55 loc) · 2.09 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
# Run Python tests, lint, etc.
steps:
- id: python_install
name: python:3.7
entrypoint: python3
args: ["-m" , "pip" , "install" , "-t" , "." , "-r" , "requirements.txt"]
# We can't just test everything under our Cloud Build working directory because
# that's where python installs all of its packages also, and we don't really
# want to test all of that other unrelated code everytime.
#
# The unittest module only supports one -s path at a time, so we need multiple rules
# to get both places where we submit code.
#
- id: python_test_util
name: python:3.7
entrypoint: python3
args: ["-m", "unittest", "discover", "-v", "-s", "util/", "-p", "*_test.py"]
# In cloudbuild, everything happens under /workspace path
env: ["PYTHONPATH=/workspace:/workspace/scripts"]
waitFor:
- python_install
- id: python_test_scripts
name: python:3.7
entrypoint: python3
args: ["-m", "unittest", "discover", "-v", "-s", "scripts/", "-p", "*_test.py"]
# In cloudbuild, everything happens under /workspace path
env: ["PYTHONPATH=/workspace:/workspace/scripts"]
waitFor:
- python_install
- id: python_test_import_automation
name: python:3.7
entrypoint: python3
args: ["-m", "unittest", "discover", "-v", "-s", "import-automation/", "-p", "*_test.py"]
# In cloudbuild, everything happens under /workspace path
env: ["PYTHONPATH=/workspace:/workspace/scripts"]
waitFor:
- python_install
- id: python_format_check
name: python:3.7
entrypoint: python3
args: ["-m", "yapf", "--recursive", "--diff", "--style", "google", "util/", "scripts/", "tools/", "docs/", "schema/"]
# In cloudbuild, everything happens under /workspace path
env: ["PYTHONPATH=/workspace:/workspace/scripts"]
waitFor:
- python_install
# TODO(rsned): Uncomment once the existing source files are updated to pass lint.
#- id: python_lint
# name: python:3.7
# entrypoint: python3
# args: ["-m", "pylint", "util/", "scripts/", "import_automation"]
# # In cloudbuild, everything happens under /workspace path
# env: ["PYTHONPATH=/workspace"]
# waitFor:
# - python_install
# TODO(rsned): Add any other useful code health tools.