From b503fd7f493e995f9537651790ff2d44f1648560 Mon Sep 17 00:00:00 2001 From: wangbill <12449837+YunchuWang@users.noreply.github.com> Date: Sun, 7 Apr 2024 05:29:00 +0000 Subject: [PATCH 1/6] try cache pip --- .github/workflows/ci_ut_workflow.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_ut_workflow.yml b/.github/workflows/ci_ut_workflow.yml index 002cac245..1a2517b8f 100644 --- a/.github/workflows/ci_ut_workflow.yml +++ b/.github/workflows/ci_ut_workflow.yml @@ -37,7 +37,24 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: "8.0.x" - - name: Install dependencies and the worker + - name: get date + run: | + echo "DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV} + - uses: actions/cache@v4 + id: cache + with: + # path: ~/.cache/pip + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ env.DATE }} + # restore-keys: | + # ${{ runner.os }}-pip- + - name: Install the dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: | + python -m pip install --upgrade pip + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple -U azure-functions --pre + python -m pip install -U -e .[dev] + - name: Install the worker run: | retry() { local -r -i max_attempts="$1"; shift @@ -56,20 +73,16 @@ jobs: done } - python -m pip install --upgrade pip - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple -U azure-functions --pre - python -m pip install -U -e .[dev] - # Retry a couple times to avoid certificate issue retry 5 python setup.py build retry 5 python setup.py webhost --branch-name=dev retry 5 python setup.py extension - mkdir logs - name: Test with pytest env: AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }} # needed for installing azure-functions-durable while running setup.py ARCHIVE_WEBHOST_LOGS: ${{ github.event.inputs.archive_webhost_logging }} run: | + mkdir logs python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch tests/unittests - name: Codecov uses: codecov/codecov-action@v3 From 21ca217ccd4c3c04ef76af375f8e76287dc51db4 Mon Sep 17 00:00:00 2001 From: wangbill <12449837+YunchuWang@users.noreply.github.com> Date: Sun, 7 Apr 2024 06:17:39 +0000 Subject: [PATCH 2/6] update --- .github/workflows/ci_ut_workflow.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_ut_workflow.yml b/.github/workflows/ci_ut_workflow.yml index 1a2517b8f..e17f0b333 100644 --- a/.github/workflows/ci_ut_workflow.yml +++ b/.github/workflows/ci_ut_workflow.yml @@ -37,19 +37,21 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: "8.0.x" - - name: get date + - name: Get Date + id: get-date run: | - echo "DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV} + echo "todayDate=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_ENV + shell: bash - uses: actions/cache@v4 - id: cache + id: cache-pip with: # path: ~/.cache/pip path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ env.DATE }} - # restore-keys: | + key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ env.todayDate }} + # restore-keys: | # ${{ runner.os }}-pip- - name: Install the dependencies - if: steps.cache.outputs.cache-hit != 'true' + if: steps.cache-pip.outputs.cache-hit != 'true' run: | python -m pip install --upgrade pip python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple -U azure-functions --pre From db6dbff5b9989c514d708939bcc24c345d2dabc2 Mon Sep 17 00:00:00 2001 From: wangbill <12449837+YunchuWang@users.noreply.github.com> Date: Sun, 7 Apr 2024 06:24:28 +0000 Subject: [PATCH 3/6] add to ppls --- .github/workflows/ci_consumption_workflow.yml | 11 ++++++++++ .github/workflows/ci_e2e_workflow.yml | 20 +++++++++++++++---- .github/workflows/ci_ut_workflow.yml | 7 ++----- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci_consumption_workflow.yml b/.github/workflows/ci_consumption_workflow.yml index 907e3de4c..27de80834 100644 --- a/.github/workflows/ci_consumption_workflow.yml +++ b/.github/workflows/ci_consumption_workflow.yml @@ -30,7 +30,18 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Get Date + id: get-date + run: | + echo "todayDate=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_ENV + shell: bash + - uses: actions/cache@v4 + id: cache-pip + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ env.todayDate }} - name: Install dependencies + if: steps.cache-pip.outputs.cache-hit != 'true' run: | python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple -U azure-functions --pre python -m pip install -U -e .[dev] diff --git a/.github/workflows/ci_e2e_workflow.yml b/.github/workflows/ci_e2e_workflow.yml index 11dc7a4d9..12d7c1b00 100644 --- a/.github/workflows/ci_e2e_workflow.yml +++ b/.github/workflows/ci_e2e_workflow.yml @@ -39,6 +39,22 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: "8.0.x" + - name: Get Date + id: get-date + run: | + echo "todayDate=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_ENV + shell: bash + - uses: actions/cache@v4 + id: cache-pip + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ env.todayDate }} + - name: Install dependencies + if: steps.cache-pip.outputs.cache-hit != 'true' + run: | + python -m pip install --upgrade pip + python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple -U azure-functions --pre + python -m pip install -U -e .[dev] - name: Install dependencies and the worker run: | retry() { @@ -58,10 +74,6 @@ jobs: done } - python -m pip install --upgrade pip - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple -U azure-functions --pre - python -m pip install -U -e .[dev] - # Retry a couple times to avoid certificate issue retry 5 python setup.py build retry 5 python setup.py webhost --branch-name=dev diff --git a/.github/workflows/ci_ut_workflow.yml b/.github/workflows/ci_ut_workflow.yml index e17f0b333..3550e3903 100644 --- a/.github/workflows/ci_ut_workflow.yml +++ b/.github/workflows/ci_ut_workflow.yml @@ -45,12 +45,9 @@ jobs: - uses: actions/cache@v4 id: cache-pip with: - # path: ~/.cache/pip path: ${{ env.pythonLocation }} key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ env.todayDate }} - # restore-keys: | - # ${{ runner.os }}-pip- - - name: Install the dependencies + - name: Install dependencies if: steps.cache-pip.outputs.cache-hit != 'true' run: | python -m pip install --upgrade pip @@ -79,12 +76,12 @@ jobs: retry 5 python setup.py build retry 5 python setup.py webhost --branch-name=dev retry 5 python setup.py extension + mkdir logs - name: Test with pytest env: AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }} # needed for installing azure-functions-durable while running setup.py ARCHIVE_WEBHOST_LOGS: ${{ github.event.inputs.archive_webhost_logging }} run: | - mkdir logs python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch tests/unittests - name: Codecov uses: codecov/codecov-action@v3 From 1d46c4eff3d0cb25748e9c0720ffac8ecc20276a Mon Sep 17 00:00:00 2001 From: wangbill <12449837+YunchuWang@users.noreply.github.com> Date: Sun, 7 Apr 2024 06:35:25 +0000 Subject: [PATCH 4/6] update cache key --- .github/workflows/ci_consumption_workflow.yml | 2 +- .github/workflows/ci_e2e_workflow.yml | 2 +- .github/workflows/ci_ut_workflow.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_consumption_workflow.yml b/.github/workflows/ci_consumption_workflow.yml index 27de80834..83a3ec87d 100644 --- a/.github/workflows/ci_consumption_workflow.yml +++ b/.github/workflows/ci_consumption_workflow.yml @@ -39,7 +39,7 @@ jobs: id: cache-pip with: path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ env.todayDate }} + key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ env.todayDate }}-${{ matrix.python-version }} - name: Install dependencies if: steps.cache-pip.outputs.cache-hit != 'true' run: | diff --git a/.github/workflows/ci_e2e_workflow.yml b/.github/workflows/ci_e2e_workflow.yml index 12d7c1b00..ef36ab486 100644 --- a/.github/workflows/ci_e2e_workflow.yml +++ b/.github/workflows/ci_e2e_workflow.yml @@ -48,7 +48,7 @@ jobs: id: cache-pip with: path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ env.todayDate }} + key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ env.todayDate }}-${{ matrix.python-version }} - name: Install dependencies if: steps.cache-pip.outputs.cache-hit != 'true' run: | diff --git a/.github/workflows/ci_ut_workflow.yml b/.github/workflows/ci_ut_workflow.yml index 3550e3903..80a252ddd 100644 --- a/.github/workflows/ci_ut_workflow.yml +++ b/.github/workflows/ci_ut_workflow.yml @@ -46,7 +46,7 @@ jobs: id: cache-pip with: path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ env.todayDate }} + key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ env.todayDate }}-${{ matrix.python-version }} - name: Install dependencies if: steps.cache-pip.outputs.cache-hit != 'true' run: | From 69b9dbacbe001f20d0f45b87e6c998abfcd4333f Mon Sep 17 00:00:00 2001 From: wangbill <12449837+YunchuWang@users.noreply.github.com> Date: Sun, 7 Apr 2024 06:40:36 +0000 Subject: [PATCH 5/6] typo --- .github/workflows/ci_e2e_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_e2e_workflow.yml b/.github/workflows/ci_e2e_workflow.yml index ef36ab486..b0cc67453 100644 --- a/.github/workflows/ci_e2e_workflow.yml +++ b/.github/workflows/ci_e2e_workflow.yml @@ -55,7 +55,7 @@ jobs: python -m pip install --upgrade pip python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple -U azure-functions --pre python -m pip install -U -e .[dev] - - name: Install dependencies and the worker + - name: Install worker run: | retry() { local -r -i max_attempts="$1"; shift From 8c73d1aac65cd274caab625ed363ef1d0a08c834 Mon Sep 17 00:00:00 2001 From: wangbill <12449837+YunchuWang@users.noreply.github.com> Date: Sun, 7 Apr 2024 06:47:45 +0000 Subject: [PATCH 6/6] fix --- .github/workflows/ci_consumption_workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci_consumption_workflow.yml b/.github/workflows/ci_consumption_workflow.yml index 83a3ec87d..6ff1849e7 100644 --- a/.github/workflows/ci_consumption_workflow.yml +++ b/.github/workflows/ci_consumption_workflow.yml @@ -45,6 +45,8 @@ jobs: run: | python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple -U azure-functions --pre python -m pip install -U -e .[dev] + - name: Install worker + run: | python setup.py build - name: Running 3.7 Tests if: matrix.python-version == 3.7