|
| 1 | +# This workflow will run all tests in endtoend/tests in a docker container using the latest consumption image |
| 2 | + |
| 3 | +name: CI Docker Consumption tests |
| 4 | + |
| 5 | +on: |
| 6 | + workflow_dispatch: |
| 7 | + schedule: |
| 8 | + # Monday to Thursday 1 AM PDT build |
| 9 | + # * is a special character in YAML so you have to quote this string |
| 10 | + - cron: "0 8 * * 1,2,3,4" |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + name: "Python Docker CI Run" |
| 15 | + runs-on: ubuntu-latest |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + python-version: [ 3.7, 3.8, 3.9, "3.10" ] |
| 20 | + env: |
| 21 | + CONSUMPTION_DOCKER_TEST: "true" |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Checkout code. |
| 25 | + uses: actions/checkout@v2 |
| 26 | + - name: Set up Python ${{ matrix.python-version }} |
| 27 | + uses: actions/setup-python@v2 |
| 28 | + with: |
| 29 | + python-version: ${{ matrix.python-version }} |
| 30 | + - name: Install dependencies |
| 31 | + run: | |
| 32 | + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple -U -e .[dev] |
| 33 | + python setup.py build |
| 34 | + python setup.py webhost --branch-name=dev |
| 35 | + python setup.py extension |
| 36 | + - name: Running 3.7 Tests |
| 37 | + if: matrix.python-version == 3.7 |
| 38 | + env: |
| 39 | + AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString37 }} |
| 40 | + AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString37 }} |
| 41 | + AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString37 }} |
| 42 | + AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString37 }} |
| 43 | + AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString37 }} |
| 44 | + AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString37 }} |
| 45 | + AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString37 }} |
| 46 | + run: | |
| 47 | + python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend |
| 48 | + - name: Running 3.8 Tests |
| 49 | + if: matrix.python-version == 3.8 |
| 50 | + env: |
| 51 | + AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString38 }} |
| 52 | + AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString38 }} |
| 53 | + AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString38 }} |
| 54 | + AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString38 }} |
| 55 | + AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString38 }} |
| 56 | + AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString38 }} |
| 57 | + AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString38 }} |
| 58 | + run: | |
| 59 | + python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend |
| 60 | + - name: Running 3.9 Tests |
| 61 | + if: matrix.python-version == 3.9 |
| 62 | + env: |
| 63 | + AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString39 }} |
| 64 | + AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString39 }} |
| 65 | + AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString39 }} |
| 66 | + AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString39 }} |
| 67 | + AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString39 }} |
| 68 | + AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString39 }} |
| 69 | + AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString39 }} |
| 70 | + run: | |
| 71 | + python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend |
| 72 | + - name: Running 3.10 Tests |
| 73 | + if: matrix.python-version == 3.10 |
| 74 | + env: |
| 75 | + AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }} |
| 76 | + AzureWebJobsCosmosDBConnectionString: ${{ secrets.LinuxCosmosDBConnectionString310 }} |
| 77 | + AzureWebJobsEventHubConnectionString: ${{ secrets.LinuxEventHubConnectionString310 }} |
| 78 | + AzureWebJobsServiceBusConnectionString: ${{ secrets.LinuxServiceBusConnectionString310 }} |
| 79 | + AzureWebJobsSqlConnectionString: ${{ secrets.LinuxSqlConnectionString310 }} |
| 80 | + AzureWebJobsEventGridTopicUri: ${{ secrets.LinuxEventGridTopicUriString310 }} |
| 81 | + AzureWebJobsEventGridConnectionKey: ${{ secrets.LinuxEventGridConnectionKeyString310 }} |
| 82 | + run: | |
| 83 | + python -m pytest -n auto --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/endtoend |
| 84 | + - name: Codecov |
| 85 | + |
| 86 | + with: |
| 87 | + file: ./coverage.xml # optional |
| 88 | + flags: unittests # optional |
| 89 | + name: codecov # optional |
| 90 | + fail_ci_if_error: false # optional (default = false) |
0 commit comments