-
Notifications
You must be signed in to change notification settings - Fork 33
52 lines (48 loc) · 1.52 KB
/
ci-lambda.yml
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
name: CI - Python
on:
pull_request:
paths:
- "**/*.py"
- "**/*requirement*.txt"
merge_group:
env:
BASE_COMMIT: ""
GH_TOKEN: ${{ github.token }}
jobs:
matrix-pytest:
runs-on: ubuntu-latest
strategy:
matrix:
projects:
[
{
projectName: "sftp-outbound-transfer-lambda",
projectRoot: "ops/terraform/services/eft/lambda_src/sftp_outbound_transfer",
testsRoot: "ops/terraform/services/eft/lambda_src/sftp_outbound_transfer/tests",
pythonVersion: "3.12",
},
]
fail-fast: false
steps:
- name: Checkout code
id: code-checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup Python Tests for affected folders
id: install-pytest-set
uses: actions/[email protected]
with:
python-version: ${{ matrix.projects.pythonVersion }}
- name: Run Python Tests per project
id: run-pytest-set
run: |
echo "Testing ${{ matrix.projects.projectName }}"
pip install --upgrade pip
if [ -f ${{ github.workspace }}/${{ matrix.projects.projectRoot }}/requirements.txt ]
then
pip install -r ${{ github.workspace }}/${{ matrix.projects.projectRoot }}/requirements.txt
fi
pip install pytest
cd ${{ github.workspace }}/${{ matrix.projects.projectRoot }}
pytest ${{ github.workspace }}/${{ matrix.projects.testsRoot }}