Skip to content

Commit 2fbc275

Browse files
l10n report win
1 parent c84d401 commit 2fbc275

File tree

2 files changed

+165
-4
lines changed

2 files changed

+165
-4
lines changed

.github/workflows/check-beta.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
win_reportable: ${{ steps.reportable.outputs.win }}
1616
mac_reportable: ${{ steps.reportable.outputs.mac }}
1717
mac_l10n_reportable: ${{ steps.reportable.outputs.mac_l10n }}
18+
win_l10n_reportable: ${{ steps.reportable.outputs.win_l10n }}
1819
steps:
1920
- name: Checkout repository
2021
uses: actions/checkout@v4
@@ -38,7 +39,9 @@ jobs:
3839
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
3940
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
4041
TESTRAIL_USERNAME: ${{ secrets.TESTRAIL_USERNAME }}
41-
run: echo mac_l10n=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Darwin"))') >> "$GITHUB_OUTPUT"
42+
run: |
43+
echo win_l10n=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Windows"))') >> "$GITHUB_OUTPUT"
44+
echo mac_l10n=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Darwin"))') >> "$GITHUB_OUTPUT"
4245
4346
Run-Win-Smoke:
4447
needs: Check-Beta-Version
@@ -62,4 +65,12 @@ jobs:
6265
uses: ./.github/workflows/l10n.yml
6366
with:
6467
job_to_run: L10N-MacOS
68+
secrets: inherit
69+
70+
Run-L10N-Win-Smoke:
71+
needs: Check-Beta-Version
72+
if: ${{ needs.Check-Beta-Version.outputs.win_l10n_reportable == 'True' }}
73+
uses: ./.github/workflows/l10n.yml
74+
with:
75+
job_to_run: L10N-Windows
6576
secrets: inherit

.github/workflows/l10n.yml

Lines changed: 153 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
type: string
1717
workflow_dispatch:
1818
inputs:
19+
win_installer_link:
20+
description: 'The link to the Windows installer (win64) for the Fx under test'
21+
required: false
22+
type: string
1923
mac_installer_link:
2024
description: 'The link to the macOS installer for the Fx under test'
2125
required: false
@@ -118,7 +122,7 @@ jobs:
118122
name: artifacts-mac
119123
path: artifacts-mac
120124
L10N-Linux:
121-
if: ${{ github.event_name == 'pull_request' || inputs.job_to_run == 'L10N-MacOS' || inputs.linux_tarball_link }}
125+
if: ${{ inputs.linux_tarball_link }}
122126
runs-on: ubuntu-latest
123127
steps:
124128
- name: Create app token
@@ -141,7 +145,7 @@ jobs:
141145
MANUAL_DOWNLOAD_LINK: ${{ inputs.linux_tarball_link }}
142146
run: |
143147
echo "MANUAL='true'" >> "$GITHUB_ENV";
144-
echo "Running smoke tests on supplied executable";
148+
echo "Running l10n tests on supplied executable";
145149
sudo apt install gnome-screenshot
146150
uname -m;
147151
mkdir -p artifacts;
@@ -190,10 +194,149 @@ jobs:
190194
fi
191195
exit $SCRIPT_EXIT_CODE
192196
197+
198+
199+
L10N-Windows:
200+
if: ${{ inputs.job_to_run == 'L10N-Windows' || github.event_name == 'pull_request' || inputs.win_installer_link }}
201+
runs-on: windows-latest
202+
steps:
203+
- name: Create app token
204+
uses: actions/create-github-app-token@v1
205+
id: app-token
206+
with:
207+
app-id: ${{ secrets.BOT_CLIENT_ID }}
208+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
209+
- name: Checkout repository
210+
uses: actions/checkout@v4
211+
with:
212+
token: ${{ steps.app-token.outputs.token }}
213+
- name: Set up Python 3.11
214+
uses: actions/setup-python@v5
215+
with:
216+
python-version: "3.11"
217+
- name: Set Environment (Manual)
218+
if: ${{ inputs.win_installer_link }}
219+
run: |
220+
$env_contents = @"
221+
MANUAL='true'
222+
"@
223+
New-item -Name .env -Value $env_contents -ItemType File -Force
224+
Write-Host "Running l10n tests on supplied executable"
225+
- name: Set Environment (Scheduled Beta)
226+
if: ${{ inputs.job_to_run == 'Smoke-Windows' }}
227+
run: |
228+
$env_contents = @"
229+
TESTRAIL_REPORT='true'
230+
"@
231+
New-item -Name .env -Value $env_contents -ItemType File -Force
232+
Write-Host "Running report for most recent Beta on Windows"
233+
Write-Host "$env:TESTRAIL_USERNAME"
234+
- name: Install dependencies
235+
run: |
236+
mkdir -p artifacts;
237+
pip3 install 'pipenv==2023.11.15';
238+
pip3 install 'ruff>=0.4.8,<0.5';
239+
rm ./pyproject.toml;
240+
mv ./ci_pyproject.toml ./pyproject.toml;
241+
pipenv install;
242+
- name: Download Geckodriver
243+
run: |
244+
$gecko_url = (pipenv run python collect_executables.py -g) -join "`n"
245+
echo $gecko_url
246+
Invoke-WebRequest -Uri $gecko_url -OutFile "geckodriver.zip"
247+
unzip geckodriver.zip
248+
shell: pwsh
249+
- name: Download Beta
250+
if: ${{ !inputs.win_installer_link }}
251+
run: |
252+
$fx_url = (pipenv run python collect_executables.py) -join "`n"
253+
echo $fx_url
254+
Invoke-WebRequest -Uri $fx_url -OutFile "${{ github.workspace }}\setup.exe"
255+
New-Item -ItemType Directory -Path "C:\Program Files\Custom Firefox" -Force
256+
shell: pwsh
257+
- name: Download Executable
258+
if: ${{ inputs.win_installer_link }}
259+
run: |
260+
Invoke-WebRequest -Uri ${{ inputs.win_installer_link }} -OutFile "${{ github.workspace }}\setup.exe"
261+
New-Item -ItemType Directory -Path "C:\Program Files\Custom Firefox" -Force
262+
shell: pwsh
263+
- name: Install Beta
264+
id: setup
265+
run: |
266+
Start-Process -FilePath "${{ github.workspace }}\setup.exe" -ArgumentList "/S", '/D=C:\Program Files\Custom Firefox' -Wait -NoNewWindow -PassThru
267+
shell: pwsh
268+
- name: Run L10N Tests in Win
269+
if: steps.setup.conclusion == 'success'
270+
run: |
271+
pipenv run python -c "import sys; print(sys.platform)"
272+
$env:FX_EXECUTABLE = "C:\Program Files\Custom Firefox\firefox.exe"
273+
Start-Process -FilePath $env:FX_EXECUTABLE -ArgumentList "--version" -Wait -NoNewWindow
274+
pipenv run python check_l10n_test_cases.py
275+
"0" | Set-Content -Path "TEST_EXIT_CODE"
276+
$SCRIPT_EXIT_CODE = 0
277+
Get-Content "selected_l10n_mappings" | ForEach-Object {
278+
$line = $_
279+
Write-Host "Running tests for: $line"
280+
try {
281+
pipenv run python l10n_CM/run_l10n.py --fx-executable="$env:FX_EXECUTABLE" $line
282+
} catch {
283+
$SCRIPT_EXIT_CODE = $_.Exception.HResult
284+
}
285+
}
286+
mv artifacts artifacts-win || true
287+
$EXIT_CODE = Get-Content -Path "TEST_EXIT_CODE"
288+
if ($EXIT_CODE -ne 0) {
289+
exit [int]$EXIT_CODE
290+
}
291+
exit $env:SCRIPT_EXIT_CODE
292+
- name: Run L10N Tests in Win (Headed)
293+
if: steps.setup.conclusion == 'success' && always()
294+
env:
295+
REPORTABLE: true
296+
run: |
297+
rm ./pyproject.toml;
298+
mv ./ci_l10n_pyproject_headed.toml ./pyproject.toml;
299+
$env:FX_EXECUTABLE = "C:\Program Files\Custom Firefox\firefox.exe"
300+
pipenv run python check_l10n_test_cases.py
301+
"0" | Set-Content -Path "TEST_EXIT_CODE"
302+
$SCRIPT_EXIT_CODE = 0
303+
Get-Content "selected_l10n_mappings" | ForEach-Object {
304+
$line = $_
305+
Write-Host "Running tests for: $line"
306+
try {
307+
pipenv run python l10n_CM/run_l10n.py --fx-executable="$env:FX_EXECUTABLE" $line
308+
} catch {
309+
$SCRIPT_EXIT_CODE = $_.Exception.HResult
310+
}
311+
}
312+
rm artifacts/assets -r -Force
313+
Get-ChildItem -Path "artifacts" | ForEach-Object {
314+
$destPath = "artifacts-win\" + $_.Name
315+
if (-not (Test-Path -Path $destPath)) {
316+
try {
317+
Move-Item -Path $_.FullName -Destination $destPath
318+
} catch {
319+
# Ignore errors and continue
320+
}
321+
}
322+
}
323+
$EXIT_CODE = Get-Content -Path "TEST_EXIT_CODE"
324+
if ($EXIT_CODE -ne 0) {
325+
exit [int]$EXIT_CODE
326+
}
327+
exit $env:SCRIPT_EXIT_CODE
328+
- name: Upload artifacts
329+
if: ${{ always() && github.event_name == 'pull_request' }}
330+
uses: actions/upload-artifact@v4
331+
with:
332+
name: artifacts-win
333+
path: artifacts-win
334+
193335
Use-Artifacts:
194336
if: ${{ github.event_name != 'workflow_dispatch' }}
195337
runs-on: ubuntu-latest
196338
needs:
339+
- L10N-Windows
197340
- L10N-MacOS
198341
steps:
199342
- name: Checkout repository
@@ -206,11 +349,18 @@ jobs:
206349
run: |
207350
pip3 install 'pipenv==2023.11.15'
208351
pipenv install
352+
- name: Download Windows artifact
353+
uses: actions/download-artifact@v4
354+
with:
355+
name: artifacts-win
356+
path: artifacts-win
209357
- name: Download MacOS artifact
210358
uses: actions/download-artifact@v4
211359
with:
212360
name: artifacts-mac
213361
path: artifacts-mac
362+
- name: List downloaded files
363+
run: ls artifacts-win/
214364
- name: List downloaded MacOS files
215365
run: ls artifacts-mac/
216366
- name: Run script with secret
@@ -222,4 +372,4 @@ jobs:
222372
GITHUB_ACTOR: ${{ github.actor }}
223373
GITHUB_REF_NAME: ${{ github.ref_name }}
224374
run: |
225-
pipenv run python notifier.py
375+
pipenv run python notifier.py

0 commit comments

Comments
 (0)