From 97513ca4cc467ca0d96afb3becf24f7cf5986902 Mon Sep 17 00:00:00 2001 From: Lina Tang Date: Mon, 11 Mar 2024 16:02:07 +0800 Subject: [PATCH] Add merge main branch step --- .../workflows/promptflow-tracing-e2e-test.yml | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/workflows/promptflow-tracing-e2e-test.yml b/.github/workflows/promptflow-tracing-e2e-test.yml index fe75616a000f..0f6e365e20fb 100644 --- a/.github/workflows/promptflow-tracing-e2e-test.yml +++ b/.github/workflows/promptflow-tracing-e2e-test.yml @@ -1,25 +1,18 @@ name: promptflow-tracing-e2e-test - on: schedule: - cron: "40 17 * * *" # Every day starting at 1:40 BJT - pull_request_target: paths: - src/promptflow/** - scripts/building/** - .github/workflows/promptflow-tracing-e2e-test.yml - workflow_dispatch: - - env: packageSetupType: promptflow_with_extra testWorkingDirectory: ${{ github.workspace }}/src/promptflow PYTHONPATH: ${{ github.workspace }}/src/promptflow IS_IN_CI_PIPELINE: "true" - - jobs: authorize: environment: @@ -38,6 +31,11 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + fetch-depth: 0 + - name: merge main to current branch + uses: "./.github/actions/step_merge_main" - name: Display and Set Environment Variables run: | env | sort >> $GITHUB_OUTPUT @@ -60,7 +58,6 @@ jobs: path: | ${{ github.workspace }}/src/promptflow/dist/*.whl ${{ github.workspace }}/src/promptflow-tools/dist/*.whl - tracing_tests: needs: build strategy: @@ -72,24 +69,25 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 - + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + fetch-depth: 0 + - name: merge main to current branch + uses: "./.github/actions/step_merge_main" - name: Display and Set Environment Variables run: | env | sort >> $GITHUB_OUTPUT id: display_env shell: bash -el {0} - - name: Python Setup - ${{ matrix.os }} - Python Version ${{ matrix.pythonVersion }} uses: "./.github/actions/step_create_python_environment" with: pythonVersion: ${{ matrix.pythonVersion }} - - name: Download Artifacts uses: actions/download-artifact@v3 with: name: wheel path: artifacts - - name: Install wheel shell: pwsh working-directory: artifacts @@ -99,21 +97,17 @@ jobs: gci ./promptflow -Recurse | % {if ($_.Name.Contains('.whl')) {python -m pip install "$($_.FullName)"}} gci ./promptflow-tools -Recurse | % {if ($_.Name.Contains('.whl')) {python -m pip install $_.FullName}} pip freeze - - name: Azure Login uses: azure/login@v1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Generate Configs uses: "./.github/actions/step_generate_configs" with: targetFolder: ${{ env.testWorkingDirectory }} - - name: Get number of CPU cores uses: SimenB/github-actions-cpu-cores@v1 id: cpu-cores - - name: run promptflow-tracing test shell: pwsh working-directory: ${{ env.testWorkingDirectory }} @@ -126,7 +120,6 @@ jobs: -n ${{ steps.cpu-cores.outputs.count }} ` --coverage-config ${{ github.workspace }}/src/promptflow/tests/tracing_test/.coveragerc ` -o "${{ env.testWorkingDirectory }}/test-results-tracing.xml" - - name: Upload Test Results if: always() uses: actions/upload-artifact@v3 @@ -135,22 +128,24 @@ jobs: path: | ${{ env.testWorkingDirectory }}/*.xml ${{ env.testWorkingDirectory }}/htmlcov/ - - publish-test-results-tracing-test: + name: "Publish Tests Results" needs: tracing_tests if: always() - runs-on: ubuntu-latest permissions: checks: write pull-requests: write contents: read issues: read - steps: - name: checkout uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + fetch-depth: 0 + - name: merge main to current branch + uses: "./.github/actions/step_merge_main" - name: Publish Test Results uses: "./.github/actions/step_publish_test_results" with: