Skip to content

Commit a947a4d

Browse files
authored
Merge pull request #477 from mozilla/Pat/update_workflow_logic
Updated workflow
2 parents 5d8d867 + 863b4ac commit a947a4d

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

.github/workflows/check-beta.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212
Check-Beta-Version:
1313
runs-on: ubuntu-latest
1414
outputs:
15-
reportable: ${{ steps.reportable.outputs.test }}
15+
win_reportable: ${{ steps.reportable.outputs.win }}
16+
mac_reportable: ${{ steps.reportable.outputs.mac }}
1617
steps:
1718
- name: Checkout repository
1819
uses: actions/checkout@v4
@@ -26,9 +27,21 @@ jobs:
2627
run: |
2728
pip3 install 'pipenv==2023.11.15';
2829
pipenv install
29-
echo test=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable())') >> "$GITHUB_OUTPUT"
30-
Run-Smoke-Tests:
30+
echo win=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Windows"))') >> "$GITHUB_OUTPUT"
31+
echo mac=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Darwin"))') >> "$GITHUB_OUTPUT"
32+
Run-Win-Smoke:
3133
needs: Check-Beta-Version
32-
if: ${{ needs.Check-Beta-Version.outputs.reportable == 'True' }}
34+
if: ${{ needs.Check-Beta-Version.outputs.win_reportable == 'True' }}
3335
uses: ./.github/workflows/smoke.yml
36+
with:
37+
job_to_run: Smoke-Windows
3438
secrets: inherit
39+
40+
Run-Mac-Smoke:
41+
needs: Check-Beta-Version
42+
if: ${{ needs.Check-Beta-Version.outputs.mac_reportable == 'True' }}
43+
uses: ./.github/workflows/smoke.yml
44+
with:
45+
job_to_run: Smoke-MacOS
46+
secrets: inherit
47+

.github/workflows/smoke.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ run-name: ${{ github.actor }} is running smoke tests
55
on:
66
pull_request:
77
workflow_call:
8+
inputs:
9+
job_to_run:
10+
required: true
11+
type: string
812
env:
913
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
1014
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
@@ -30,7 +34,7 @@ jobs:
3034
with:
3135
python-version: "3.11"
3236
- name: Set Environment
33-
if: ${{ github.event_name == 'schedule' }}
37+
if: ${{ inputs.job_to_run == 'Smoke-Windows' }}
3438
run: |
3539
$env_contents = @"
3640
TESTRAIL_REPORT='true'
@@ -128,7 +132,7 @@ jobs:
128132
exit $?
129133
echo "Triggered by event: ${{ github.event_name }}"
130134
- name: Set Environment
131-
if: ${{ github.event_name == 'schedule' }}
135+
if: ${{ inputs.job_to_run == 'Smoke-MacOS' }}
132136
run: |
133137
echo "TESTRAIL_REPORT='true'" >> "$GITHUB_ENV";
134138
echo "Running report for most recent Beta on MacOS";

modules/testrail_integration.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def tc_reportable():
6363
sys.exit(100)
6464

6565

66-
def reportable():
66+
def reportable(platform_to_test=None):
6767
"""Return true if we should report to TestRail"""
6868
import platform
6969

@@ -118,6 +118,8 @@ def reportable():
118118
)
119119
return True
120120

121+
if platform_to_test:
122+
sys_platform = platform_to_test
121123
platform = "MacOS" if sys_platform == "Darwin" else sys_platform
122124

123125
plan_entries = this_plan.get("entries")

0 commit comments

Comments
 (0)