diff --git a/.github/workflows/ubuntu_22.yml b/.github/workflows/ubuntu_22.yml index 2bac36dbf420a8..eabd9361ac24ad 100644 --- a/.github/workflows/ubuntu_22.yml +++ b/.github/workflows/ubuntu_22.yml @@ -12,6 +12,10 @@ on: description: 'Target branch for the build; taken from event context by default' type: string required: false + pytorch-models-nightly: + description: 'Run nightly PyTorch model hub tests' + type: boolean + default: false pull_request: types: - opened @@ -45,6 +49,7 @@ jobs: changed_components: "${{ steps.smart_ci.outputs.changed_components }}" skip_workflow: "${{ steps.smart_ci.outputs.skip_workflow }}" use_latest_onednn: "${{ steps.onednn_day.outputs.use_latest_onednn }}" + pytorch_models_nightly: "${{ steps.pytorch_models_nightly.outputs.changed }}" steps: - name: checkout action uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries @@ -82,6 +87,19 @@ jobs: echo "use_latest_onednn=false" >> "$GITHUB_OUTPUT" fi + - name: Check if nightly PyTorch model tests are changed + id: pytorch_models_nightly + if: ${{ github.event_name == 'pull_request' }} + shell: bash + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.number }} + run: | + files=$(gh api --paginate "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files" --jq '.[].filename') + if grep -qE '^(tests/model_hub_tests/(pytorch|models_hub_common)/|\.github/workflows/job_pytorch_models_tests\.yml$)' <<< "$files"; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + Docker: needs: Smart_CI runs-on: aks-linux-4-cores-16gb-docker-build @@ -469,7 +487,8 @@ jobs: PyTorch_Models_Tests_Nightly_Scope1: name: PyTorch Models Nightly Scope1 tests - if: ${{ github.event_name == 'schedule' }} + if: ${{ github.event_name == 'schedule' || inputs.pytorch-models-nightly || + needs.smart_ci.outputs.pytorch_models_nightly == 'true' }} needs: [ Docker, Build, Smart_CI, Openvino_tokenizers ] uses: ./.github/workflows/job_pytorch_models_tests.yml with: @@ -479,7 +498,8 @@ jobs: PyTorch_Models_Tests_Nightly_Scope2: name: PyTorch Models Nightly Scope2 tests - if: ${{ github.event_name == 'schedule' }} + if: ${{ github.event_name == 'schedule' || inputs.pytorch-models-nightly || + needs.smart_ci.outputs.pytorch_models_nightly == 'true' }} needs: [ Docker, Build, Smart_CI, Openvino_tokenizers ] uses: ./.github/workflows/job_pytorch_models_tests.yml with: