Skip to content

Commit

Permalink
Add merge main branch step
Browse files Browse the repository at this point in the history
  • Loading branch information
Lina Tang committed Mar 11, 2024
1 parent ccd667b commit 97513ca
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions .github/workflows/promptflow-tracing-e2e-test.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -60,7 +58,6 @@ jobs:
path: |
${{ github.workspace }}/src/promptflow/dist/*.whl
${{ github.workspace }}/src/promptflow-tools/dist/*.whl
tracing_tests:
needs: build
strategy:
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 97513ca

Please sign in to comment.