-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-run-checks-and-tests.yml
More file actions
96 lines (87 loc) · 3.19 KB
/
python-run-checks-and-tests.yml
File metadata and controls
96 lines (87 loc) · 3.19 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
name: Run Styling/Typing/Lint Checks and Tests
on:
workflow_call:
inputs:
start-services-with-docker-compose:
required: false
type: boolean
default: false
custom-pre-checks-script:
required: false
type: string
default: ""
module:
required: true
type: string
additional-modules-to-lint:
description: Additional modules to be linted using the standard ruleset (i.e. not the ones used for linting unit tests).
required: false
type: string
default: ""
dependency-hash-version:
required: false
type: string
default: "v1"
private-package-repo-url:
description: The url of the private package repository you want to add to poetry. You must also specify `private-package-repo-username`
type: string
required: false
default: ""
extras:
description: Extras to include when installing this package
type: string
required: false
default: NOT_SPECIFIED
working-directory:
description: The working directory where this action should run. Defaults to the root of the git repository.
type: string
required: false
default: "."
python-version:
description: The version of python to install/use
type: string
required: false
default: "3.8"
skip-coverage-check:
description: Set to true to disable enforcement of 100% code coverage.
type: boolean
required: false
default: false
secrets:
private-package-repo-username:
required: false
private-package-repo-password:
required: false
jobs:
checks:
name: Run Styling/Typing/Lint Checks and Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Start Services
if: inputs.start-services-with-docker-compose
run: docker compose up -d
- name: Setup python and poetry and install dependencies
uses: triaxtec/github-actions/python/setup-python-and-poetry-and-install-dependencies@v3
with:
python-version: ${{ inputs.python-version }}
private-package-repo-url: ${{ inputs.private-package-repo-url }}
private-package-repo-username: ${{ secrets.private-package-repo-username }}
private-package-repo-password: ${{ secrets.private-package-repo-password }}
dependency-hash-version: ${{ inputs.dependency-hash-version }}
extras: ${{ inputs.extras }}
working-directory: ${{ inputs.working-directory }}
- name: Custom pre-checks script
if: inputs.custom-pre-checks-script
run: ${{ inputs.custom-pre-checks-script }}
- name: Run Checks and Tests
uses: triaxtec/github-actions/python/run-checks@v3
with:
module: ${{ inputs.module }}
additional-modules-to-lint: ${{ inputs.additional-modules-to-lint }}
skip-coverage-check: ${{ inputs.skip-coverage-check }}
env:
AWS_DEFAULT_REGION: us-east-1
- name: Uninstall package before caching
run: poetry run pip uninstall ${{ inputs.module }} -y