Skip to content

Commit 0ba8e25

Browse files
authored
add linux flow for manual execution (#573)
1 parent e26cdbb commit 0ba8e25

File tree

2 files changed

+79
-12
lines changed

2 files changed

+79
-12
lines changed

.github/workflows/smoke.yml

Lines changed: 72 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ on:
1616
type: string
1717
workflow_dispatch:
1818
inputs:
19-
win_executable_link:
20-
description: 'The link to the Windows executable to run smoke tests for'
19+
win_installer_link:
20+
description: 'The link to the Windows installer for the Fx under test'
2121
required: true
2222
type: string
23-
mac_executable_link:
24-
description: 'The link to the macOS executable to run smoke tests for'
23+
mac_installer_link:
24+
description: 'The link to the macOS installer for the Fx under test'
25+
required: true
26+
type: string
27+
linux_tarball_link:
28+
description: 'The link to the Linux tarball for the Fx under test'
2529
required: true
2630
type: string
2731
env:
@@ -51,7 +55,7 @@ jobs:
5155
with:
5256
python-version: "3.11"
5357
- name: Set Environment (Manual)
54-
if: ${{ inputs.win_executable_link }}
58+
if: ${{ inputs.win_installer_link }}
5559
run: |
5660
$env_contents = @"
5761
MANUAL='true'
@@ -83,17 +87,17 @@ jobs:
8387
unzip geckodriver.zip
8488
shell: pwsh
8589
- name: Download Beta
86-
if: ${{ !inputs.win_executable_link }}
90+
if: ${{ !inputs.win_installer_link }}
8791
run: |
8892
$fx_url = (pipenv run python collect_executables.py) -join "`n"
8993
echo $fx_url
9094
Invoke-WebRequest -Uri $fx_url -OutFile "${{ github.workspace }}\setup.exe"
9195
New-Item -ItemType Directory -Path "C:\Program Files\Custom Firefox" -Force
9296
shell: pwsh
9397
- name: Download Executable
94-
if: ${{ inputs.win_executable_link }}
98+
if: ${{ inputs.win_installer_link }}
9599
run: |
96-
Invoke-WebRequest -Uri ${{ inputs.win_executable_link }} -OutFile "${{ github.workspace }}\setup.exe"
100+
Invoke-WebRequest -Uri ${{ inputs.win_installer_link }} -OutFile "${{ github.workspace }}\setup.exe"
97101
New-Item -ItemType Directory -Path "C:\Program Files\Custom Firefox" -Force
98102
shell: pwsh
99103
- name: Install Beta
@@ -170,7 +174,7 @@ jobs:
170174
echo "TESTRAIL_REPORT='true'" >> "$GITHUB_ENV";
171175
echo "Running report for most recent Beta on MacOS";
172176
- name: Set Environment (Manual)
173-
if: ${{ inputs.mac_executable_link }}
177+
if: ${{ inputs.mac_installer_link }}
174178
run: |
175179
echo "MANUAL='true'" >> "$GITHUB_ENV";
176180
echo "Running smoke tests on supplied executable";
@@ -185,7 +189,7 @@ jobs:
185189
- name: Install Fx
186190
id: setup
187191
env:
188-
MANUAL_DOWNLOAD_LINK: ${{ inputs.mac_executable_link }}
192+
MANUAL_DOWNLOAD_LINK: ${{ inputs.mac_installer_link }}
189193
run:
190194
echo app_name=$(bash ./collect_executables.sh | xargs -0 ./parse_executables.sh) >> "$GITHUB_OUTPUT"
191195
- name: Run Smoke Tests in MacOS
@@ -215,6 +219,64 @@ jobs:
215219
with:
216220
name: artifacts-mac
217221
path: artifacts-mac
222+
Smoke-Linux:
223+
if: ${{ github.event_name == 'workflow_dispatch' }}
224+
runs-on: ubuntu-latest
225+
steps:
226+
- name: Create app token
227+
uses: actions/create-github-app-token@v1
228+
id: app-token
229+
with:
230+
app-id: ${{ secrets.BOT_CLIENT_ID }}
231+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
232+
- name: Checkout repository
233+
uses: actions/checkout@v4
234+
with:
235+
token: ${{ steps.app-token.outputs.token }}
236+
- name: Set up Python 3.11
237+
uses: actions/setup-python@v5
238+
with:
239+
python-version: "3.11"
240+
- name: Check test case numbers
241+
run: |
242+
python check_test_cases.py
243+
exit $?
244+
echo "Triggered by event: ${{ github.event_name }}"
245+
- name: Install dependencies
246+
id: setup
247+
env:
248+
MANUAL_DOWNLOAD_LINK: ${{ inputs.linux_tarball_link }}
249+
run: |
250+
echo "MANUAL='true'" >> "$GITHUB_ENV";
251+
echo "Running smoke tests on supplied executable";
252+
mkdir -p artifacts;
253+
pip3 install 'pipenv==2023.11.15';
254+
pip3 install 'ruff>=0.4.8,<0.5';
255+
rm ./pyproject.toml;
256+
mv ./ci_pyproject.toml ./pyproject.toml;
257+
pipenv install;
258+
./collect_executables.sh
259+
./firefox/firefox --version;
260+
. ./keyring-unlock.sh;
261+
- name: Run Smoke Tests in Ubuntu
262+
if: steps.setup.conclusion == 'success'
263+
env:
264+
FX_EXECUTABLE: ./firefox/firefox
265+
run: |
266+
"$FX_EXECUTABLE" --version
267+
pipenv run python choose_ci_set.py
268+
pipenv run pytest --fx-executable="$FX_EXECUTABLE" -n 4 $(cat selected_tests) || TEST_EXIT_CODE=$?
269+
exit $TEST_EXIT_CODE
270+
- name: Run Smoke Tests in Ubuntu (Headed)
271+
if: steps.setup.conclusion == 'success' && always()
272+
env:
273+
FX_EXECUTABLE: ./firefox/firefox
274+
REPORTABLE: true
275+
run: |
276+
mv ./ci_pyproject_headed.toml ./pyproject.toml;
277+
pipenv run python choose_ci_set.py
278+
pipenv run pytest --fx-executable="$FX_EXECUTABLE" $(cat selected_tests) || TEST_EXIT_CODE=$?
279+
exit $TEST_EXIT_CODE
218280
219281
Use-Artifacts:
220282
runs-on: ubuntu-latest

collect_executables.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ then
1212
fi
1313
hdiutil attach Firefox.dmg
1414
else
15-
pipenv run python collect_executables.py
16-
curl -o firefox.tar.xz -L "$(pipenv run python collect_executables.py)"
15+
if [ -n "$MANUAL_DOWNLOAD_LINK" ]
16+
then
17+
curl -o firefox.tar.xz -L "${MANUAL_DOWNLOAD_LINK}"
18+
else
19+
pipenv run python collect_executables.py
20+
curl -o firefox.tar.xz -L "$(pipenv run python collect_executables.py)"
21+
fi
1722
tar xf firefox.tar.xz
1823
fi
1924
curl -o geckodriver.tar.gz -L "$(pipenv run python collect_executables.py -g)"

0 commit comments

Comments
 (0)