|
39 | 39 | type: boolean |
40 | 40 | default: true |
41 | 41 |
|
| 42 | + pull_request: |
| 43 | + types: |
| 44 | + - opened |
| 45 | + - synchronize |
| 46 | + - reopened |
| 47 | + |
42 | 48 | jobs: |
43 | 49 | test-luxonis-train: |
44 | 50 | name: Test Luxonis Train |
45 | | - if: ${{ inputs.run_train }} |
| 51 | + if: >- |
| 52 | + (github.event_name == 'workflow_dispatch' && inputs.run_train) || |
| 53 | + (github.event_name == 'pull_request' && |
| 54 | + startsWith(github.head_ref, 'release/') && |
| 55 | + github.event.pull_request.base.ref == 'main') |
46 | 56 | uses: Luxonis/luxonis-train/.github/workflows/tests.yaml@main |
47 | 57 | with: |
48 | | - ml_ref: ${{ inputs.ml_ref }} |
49 | | - train_ref: ${{ inputs.train_ref }} |
| 58 | + ml_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ml_ref || github.head_ref }} |
| 59 | + train_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.train_ref || 'main' }} |
50 | 60 | secrets: |
51 | 61 | GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }} |
52 | 62 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
53 | 63 |
|
54 | 64 | test-modelconverter: |
55 | 65 | name: Test Modelconverter |
56 | | - if: ${{ inputs.run_modelconv }} |
| 66 | + if: >- |
| 67 | + (github.event_name == 'workflow_dispatch' && inputs.run_modelconv) || |
| 68 | + (github.event_name == 'pull_request' && |
| 69 | + startsWith(github.head_ref, 'release/') && |
| 70 | + github.event.pull_request.base.ref == 'main') |
57 | 71 | uses: Luxonis/modelconverter/.github/workflows/unittests.yaml@main |
58 | 72 | with: |
59 | | - ml_ref: ${{ inputs.ml_ref }} |
60 | | - modelconv_ref: ${{ inputs.modelconv_ref }} |
| 73 | + ml_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ml_ref || github.head_ref }} |
| 74 | + modelconv_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.modelconv_ref || 'main' }} |
61 | 75 | secrets: |
62 | 76 | AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
63 | 77 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
64 | 78 | AWS_S3_ENDPOINT_URL: ${{ secrets.AWS_S3_ENDPOINT_URL }} |
65 | 79 | GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }} |
66 | 80 | HUBAI_API_KEY: ${{ secrets.HUBAI_API_KEY }} |
67 | 81 |
|
68 | | - |
69 | 82 | test-luxonis-tools: |
70 | 83 | name: Test Luxonis Tools |
71 | | - if: ${{ inputs.run_tools }} |
| 84 | + if: >- |
| 85 | + (github.event_name == 'workflow_dispatch' && inputs.run_tools) || |
| 86 | + (github.event_name == 'pull_request' && |
| 87 | + startsWith(github.head_ref, 'release/') && |
| 88 | + github.event.pull_request.base.ref == 'main') |
72 | 89 | uses: Luxonis/tools/.github/workflows/unittests.yaml@main |
73 | 90 | with: |
74 | | - ml_ref: ${{ inputs.ml_ref }} |
75 | | - tools_ref: ${{ inputs.tools_ref }} |
| 91 | + ml_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ml_ref || github.head_ref }} |
| 92 | + tools_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tools_ref || 'main' }} |
0 commit comments