1
- # This workflow will run all tests in endtoend/tests in a docker container using custom dedicated or consumption image
1
+ # This workflow will run all tests in endtoend/tests in a docker container using the latest dedicated image
2
2
3
3
4
4
name : CI Docker Dedicated tests
5
5
6
6
on :
7
7
workflow_dispatch :
8
- inputs :
9
- image_name :
10
- description : ' Image'
11
- required : true
12
- python_version :
13
- description : ' Python Version'
14
- required : true
15
- type : choice
16
- default : ' 3.11'
17
- options : [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
18
- DEDICATED_DOCKER_TEST :
19
- description : ' Is this Dedicated Image?'
20
- required : true
21
- type : choice
22
- default : ' true'
23
- options : [ 'true', 'false' ]
24
- CONSUMPTION_DOCKER_TEST :
25
- description : ' Is this Consumption Image?'
26
- required : true
27
- type : choice
28
- default : ' false'
29
- options : [ 'true', 'false' ]
8
+ schedule :
9
+ # Monday to Thursday 1 AM PDT build
10
+ # * is a special character in YAML so you have to quote this string
11
+ - cron : " 0 8 * * 1,2,3,4"
30
12
31
13
jobs :
32
14
build :
33
15
name : " Python Docker CI Run"
34
16
runs-on : ubuntu-latest
35
17
strategy :
36
18
fail-fast : false
19
+ matrix :
20
+ python-version : [ 3.7, 3.8, 3.9, "3.10" ]
37
21
env :
38
- DEDICATED_DOCKER_TEST : ${{ github.event.inputs.DEDICATED_DOCKER_TEST }}
39
- CONSUMPTION_DOCKER_TEST : ${{ github.event.inputs.CONSUMPTION_DOCKER_TEST }}
40
- python_version : ${{ github.event.inputs.python_version }}
41
- IMAGE_NAME : ${{ github.event.inputs.image_name }}
22
+ DEDICATED_DOCKER_TEST : " true"
23
+
42
24
steps :
43
25
- name : Checkout code.
44
26
uses : actions/checkout@v2
45
- - name : Set up Python ${{ env.python_version }}
27
+ - name : Set up Python ${{ matrix.python-version }}
46
28
uses : actions/setup-python@v2
47
29
with :
48
- python-version : ${{ env.python_version }}
30
+ python-version : ${{ matrix.python-version }}
49
31
- name : Install dependencies
50
32
run : |
51
33
python -m pip install -U -e .[dev]
52
34
- name : Running 3.7 Tests
53
- if : env.python_version == 3.7
35
+ if : matrix.python-version == 3.7
54
36
env :
55
37
AzureWebJobsStorage : ${{ secrets.LinuxStorageConnectionString37 }}
56
38
AzureWebJobsCosmosDBConnectionString : ${{ secrets.LinuxCosmosDBConnectionString37 }}
60
42
AzureWebJobsEventGridTopicUri : ${{ secrets.LinuxEventGridTopicUriString37 }}
61
43
AzureWebJobsEventGridConnectionKey : ${{ secrets.LinuxEventGridConnectionKeyString37 }}
62
44
run : |
63
- python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
45
+ python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
64
46
- name : Running 3.8 Tests
65
- if : env.python_version == 3.8
47
+ if : matrix.python-version == 3.8
66
48
env :
67
49
AzureWebJobsStorage : ${{ secrets.LinuxStorageConnectionString38 }}
68
50
AzureWebJobsCosmosDBConnectionString : ${{ secrets.LinuxCosmosDBConnectionString38 }}
72
54
AzureWebJobsEventGridTopicUri : ${{ secrets.LinuxEventGridTopicUriString38 }}
73
55
AzureWebJobsEventGridConnectionKey : ${{ secrets.LinuxEventGridConnectionKeyString38 }}
74
56
run : |
75
- python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
57
+ python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
76
58
- name : Running 3.9 Tests
77
- if : env.python_version == 3.9
59
+ if : matrix.python-version == 3.9
78
60
env :
79
61
AzureWebJobsStorage : ${{ secrets.LinuxStorageConnectionString39 }}
80
62
AzureWebJobsCosmosDBConnectionString : ${{ secrets.LinuxCosmosDBConnectionString39 }}
84
66
AzureWebJobsEventGridTopicUri : ${{ secrets.LinuxEventGridTopicUriString39 }}
85
67
AzureWebJobsEventGridConnectionKey : ${{ secrets.LinuxEventGridConnectionKeyString39 }}
86
68
run : |
87
- python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
69
+ python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
88
70
- name : Running 3.10 Tests
89
- if : env.python_version == 3.10
71
+ if : matrix.python-version == 3.10
90
72
env :
91
73
AzureWebJobsStorage : ${{ secrets.LinuxStorageConnectionString310 }}
92
74
AzureWebJobsCosmosDBConnectionString : ${{ secrets.LinuxCosmosDBConnectionString310 }}
@@ -96,16 +78,11 @@ jobs:
96
78
AzureWebJobsEventGridTopicUri : ${{ secrets.LinuxEventGridTopicUriString310 }}
97
79
AzureWebJobsEventGridConnectionKey : ${{ secrets.LinuxEventGridConnectionKeyString310 }}
98
80
run : |
99
- python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
100
- - name : Running 3.11 Tests
101
- if : env.python_version == 3.11
102
- env :
103
- AzureWebJobsStorage : ${{ secrets.LinuxStorageConnectionString311 }}
104
- AzureWebJobsCosmosDBConnectionString : ${{ secrets.LinuxCosmosDBConnectionString311 }}
105
- AzureWebJobsEventHubConnectionString : ${{ secrets.LinuxEventHubConnectionString311 }}
106
- AzureWebJobsServiceBusConnectionString : ${{ secrets.LinuxServiceBusConnectionString311 }}
107
- AzureWebJobsSqlConnectionString : ${{ secrets.LinuxSqlConnectionString311 }}
108
- AzureWebJobsEventGridTopicUri : ${{ secrets.LinuxEventGridTopicUriString311 }}
109
- AzureWebJobsEventGridConnectionKey : ${{ secrets.LinuxEventGridConnectionKeyString311 }}
110
- run : |
111
- python -m pytest --dist loadfile --reruns 4 -vv --instafail tests/endtoend
81
+ python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend
82
+ - name : Codecov
83
+
84
+ with :
85
+ file : ./coverage.xml # optional
86
+ flags : unittests # optional
87
+ name : codecov # optional
88
+ fail_ci_if_error : false # optional (default = false)
0 commit comments