Skip to content

Commit 7942331

Browse files
committed
Merge remote-tracking branch 'upstream/main' into 1976523
2 parents eb6a798 + 039b1c6 commit 7942331

File tree

190 files changed

+3155
-467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+3155
-467
lines changed

.github/workflows/check-beta-l10n.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check new beta version - L10N
22

33
on:
44
schedule:
5-
- cron: "40 */1 * * *"
5+
- cron: "21 */1 * * *"
66
env:
77
LATEST: ""
88
permissions:

.github/workflows/check-beta.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ jobs:
4747
uses: ./.github/workflows/smoke.yml
4848
with:
4949
job_to_run: Smoke-MacOS
50-
secrets: inherit
50+
secrets: inherit

.github/workflows/ci-dispatch.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: DTE Automation Dispatch
3+
4+
run-name: CI tests kicked off by ${{ github.actor }}
5+
on:
6+
pull_request:
7+
permissions:
8+
contents: "write"
9+
10+
jobs:
11+
Select-Channels:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
channels: ${{ steps.dispatch.outputs.channels }}
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Select test channels
19+
id: dispatch
20+
run: |
21+
python3 choose_test_channel.py
22+
echo channels=$(python3 choose_test_channel.py) >> "$GITHUB_OUTPUT"
23+
24+
25+
Run-Smoke-Win:
26+
needs: Select-Channels
27+
if: contains(fromJSON(needs.Select-Channels.outputs.channels), 'smoke')
28+
uses: ./.github/workflows/smoke.yml
29+
with:
30+
job_to_run: Smoke-Windows
31+
is_pull_request: true
32+
secrets: inherit
33+
34+
Run-Smoke-Mac:
35+
needs: Select-Channels
36+
if: contains(fromJSON(needs.Select-Channels.outputs.channels), 'smoke')
37+
uses: ./.github/workflows/smoke.yml
38+
with:
39+
job_to_run: Smoke-MacOS
40+
is_pull_request: true
41+
secrets: inherit
42+
43+
Run-L10n-Win:
44+
needs: Select-Channels
45+
if: contains(fromJSON(needs.Select-Channels.outputs.channels), 'l10n')
46+
uses: ./.github/workflows/l10n.yml
47+
with:
48+
job_to_run: L10n-Windows
49+
is_pull_request: true
50+
secrets: inherit
51+
52+
Run-L10n-Mac:
53+
needs: Select-Channels
54+
if: contains(fromJSON(needs.Select-Channels.outputs.channels), 'l10n')
55+
uses: ./.github/workflows/l10n.yml
56+
with:
57+
job_to_run: L10n-MacOS
58+
is_pull_request: true
59+
secrets: inherit
60+
61+
Run-L10n-Linux:
62+
needs: Select-Channels
63+
if: contains(fromJSON(needs.Select-Channels.outputs.channels), 'l10n')
64+
uses: ./.github/workflows/l10n.yml
65+
with:
66+
job_to_run: L10n-Linux
67+
is_pull_request: true
68+
secrets: inherit
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: L10N output mapping splits
3+
4+
run-name: ${{ github.actor }} is writing L10N mapping splits
5+
on:
6+
schedule:
7+
- cron: "0 0 * * 1"
8+
9+
permissions:
10+
contents: "write"
11+
12+
jobs:
13+
Select-Channels:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
channels: ${{ steps.splits.outputs.channels }}
17+
steps:
18+
- name: Create app token
19+
uses: actions/create-github-app-token@v1
20+
id: app-token
21+
with:
22+
app-id: ${{ secrets.BOT_CLIENT_ID }}
23+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
token: ${{ steps.app-token.outputs.token }}
28+
- name: Select test channels
29+
id: splits
30+
run: |
31+
python3 choose_l10n_beta_split.py

.github/workflows/l10n.yml

Lines changed: 15 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: L10N Test Execution
33

44
run-name: ${{ github.actor }} is running l10n tests
55
on:
6-
pull_request:
76
workflow_call:
87
inputs:
98
channel:
@@ -14,6 +13,10 @@ on:
1413
job_to_run:
1514
required: true
1615
type: string
16+
is_pull_request:
17+
description: "Is this a PR?"
18+
default: false
19+
type: boolean
1720
workflow_dispatch:
1821
inputs:
1922
win_installer_link:
@@ -38,25 +41,17 @@ env:
3841

3942
jobs:
4043
L10N-MacOS:
41-
if: ${{ inputs.job_to_run == 'L10N-MacOS' || github.event_name == 'pull_request' || inputs.mac_installer_link }}
44+
if: ${{ inputs.job_to_run == 'L10N-MacOS' || inputs.mac_installer_link }}
4245
runs-on: macos-latest
4346
steps:
44-
- name: Create app token
45-
uses: actions/create-github-app-token@v1
46-
id: app-token
47-
with:
48-
app-id: ${{ secrets.BOT_CLIENT_ID }}
49-
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
5047
- name: Checkout repository
5148
uses: actions/checkout@v4
52-
with:
53-
token: ${{ steps.app-token.outputs.token }}
5449
- name: Set up Python 3.11
5550
uses: actions/setup-python@v5
5651
with:
5752
python-version: "3.11"
5853
- name: Set Environment (Scheduled Beta)
59-
if: ${{ inputs.job_to_run == 'L10N-MacOS' }}
54+
if: ${{ inputs.job_to_run == 'L10N-MacOS' && inputs.is_pull_request == false }}
6055
run: |
6156
echo "TESTRAIL_REPORT='true'" >> "$GITHUB_ENV";
6257
echo "Running report for most recent Beta on MacOS";
@@ -97,51 +92,24 @@ jobs:
9792
exit $EXIT_CODE;
9893
fi
9994
exit $SCRIPT_EXIT_CODE;
100-
- name: Run L10N Tests in MacOS (Headed)
101-
if: steps.setup.conclusion == 'success' && always()
102-
env:
103-
FX_EXECUTABLE: /Volumes/${{ steps.setup.outputs.app_name }}/${{ steps.setup.outputs.app_name }}.app/Contents/MacOS/firefox
104-
REPORTABLE: ${{ env.TESTRAIL_REPORT == 'true' }}
105-
run: |
106-
mv ./ci_l10n_pyproject_headed.toml ./pyproject.toml;
107-
echo "0" > TEST_EXIT_CODE;
108-
while IFS= read -r line; do
109-
echo "Running tests for: $line";
110-
pipenv run python -m l10n_CM.run_l10n --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
111-
done < selected_l10n_mappings;
112-
ls artifacts-mac/* &>/dev/null || echo "No mappings to report" >> artifacts-mac/placeholder.txt
113-
mv -n artifacts/* artifacts-mac/ || true;
114-
EXIT_CODE=$(cat TEST_EXIT_CODE);
115-
if [ $EXIT_CODE != 0 ]; then
116-
exit $EXIT_CODE;
117-
fi
118-
exit $SCRIPT_EXIT_CODE;
11995
- name: Upload artifacts
12096
if: ${{ always() && github.event_name == 'pull_request' }}
12197
uses: actions/upload-artifact@v4
12298
with:
12399
name: artifacts-mac
124100
path: artifacts-mac
125101
L10N-Linux:
126-
if: ${{ inputs.job_to_run == 'L10N-Linux' || github.event_name == 'pull_request' || inputs.linux_tarball_link }}
102+
if: ${{ inputs.job_to_run == 'L10N-Linux' || inputs.linux_tarball_link }}
127103
runs-on: ubuntu-latest
128104
steps:
129-
- name: Create app token
130-
uses: actions/create-github-app-token@v1
131-
id: app-token
132-
with:
133-
app-id: ${{ secrets.BOT_CLIENT_ID }}
134-
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
135105
- name: Checkout repository
136106
uses: actions/checkout@v4
137-
with:
138-
token: ${{ steps.app-token.outputs.token }}
139107
- name: Set up Python 3.11
140108
uses: actions/setup-python@v5
141109
with:
142110
python-version: "3.11"
143111
- name: Set Environment (Scheduled Beta)
144-
if: ${{ inputs.job_to_run == 'L10N-Linux' }}
112+
if: ${{ inputs.job_to_run == 'L10N-Linux' && inputs.is_pull_request == false }}
145113
run: |
146114
echo "TESTRAIL_REPORT='true'" >> "$GITHUB_ENV";
147115
echo "Running report for most recent Beta on Linux";
@@ -180,45 +148,18 @@ jobs:
180148
exit $EXIT_CODE;
181149
fi
182150
exit $SCRIPT_EXIT_CODE;
183-
- name: Run Smoke Tests in Ubuntu (Headed)
184-
if: steps.setup.conclusion == 'success' && always()
185-
env:
186-
REPORTABLE: ${{ env.TESTRAIL_REPORT == 'true' }}
187-
FX_EXECUTABLE: ./firefox/firefox
188-
run: |
189-
mv ./ci_l10n_pyproject_headed.toml ./pyproject.toml;
190-
echo "0" > TEST_EXIT_CODE;
191-
while IFS= read -r line; do
192-
echo "Running tests for: $line";
193-
DISPLAY=:99 pipenv run python -m l10n_CM.run_l10n --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
194-
done < selected_l10n_mappings;
195-
ls artifacts-linux/* &>/dev/null || echo "No mappings to report" >> artifacts-linux/placeholder.txt
196-
mv -n artifacts/* artifacts-linux/ || true;
197-
EXIT_CODE=$(cat TEST_EXIT_CODE);
198-
if [ $EXIT_CODE != 0 ]; then
199-
exit $EXIT_CODE;
200-
fi
201-
exit $SCRIPT_EXIT_CODE;
202151
- name: Upload artifacts
203-
if: ${{ always() && github.event_name == 'pull_request' }}
152+
if: ${{ always() && inputs.is_pull_request == true }}
204153
uses: actions/upload-artifact@v4
205154
with:
206155
name: artifacts-linux
207156
path: artifacts-linux
208157
L10N-Windows:
209-
if: ${{ inputs.job_to_run == 'L10N-Windows' || github.event_name == 'pull_request' || inputs.win_installer_link }}
158+
if: ${{ inputs.job_to_run == 'L10N-Windows' || inputs.win_installer_link }}
210159
runs-on: windows-latest
211160
steps:
212-
- name: Create app token
213-
uses: actions/create-github-app-token@v1
214-
id: app-token
215-
with:
216-
app-id: ${{ secrets.BOT_CLIENT_ID }}
217-
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
218161
- name: Checkout repository
219162
uses: actions/checkout@v4
220-
with:
221-
token: ${{ steps.app-token.outputs.token }}
222163
- name: Set up Python 3.11
223164
uses: actions/setup-python@v5
224165
with:
@@ -232,7 +173,7 @@ jobs:
232173
New-item -Name .env -Value $env_contents -ItemType File -Force
233174
Write-Host "Running l10n tests on supplied executable"
234175
- name: Set Environment (Scheduled Beta)
235-
if: ${{ inputs.job_to_run == 'L10N-Windows' }}
176+
if: ${{ inputs.job_to_run == 'L10N-Windows' && inputs.is_pull_request == false}}
236177
run: |
237178
$env_contents = @"
238179
TESTRAIL_REPORT='true'
@@ -298,49 +239,8 @@ jobs:
298239
exit [int]$EXIT_CODE
299240
}
300241
exit $env:SCRIPT_EXIT_CODE
301-
- name: Run L10N Tests in Win (Headed)
302-
if: steps.setup.conclusion == 'success' && always()
303-
env:
304-
REPORTABLE: ${{ env.TESTRAIL_REPORT == 'true' }}
305-
run: |
306-
rm ./pyproject.toml;
307-
mv ./ci_l10n_pyproject_headed.toml ./pyproject.toml;
308-
$env:FX_EXECUTABLE = 'C:\Program Files\Custom Firefox\firefox.exe'
309-
Write-Host "FX_EXECUTABLE: $FX_EXECUTABLE"
310-
pipenv run python choose_l10n_ci_set.py
311-
"0" | Set-Content -Path "TEST_EXIT_CODE"
312-
$SCRIPT_EXIT_CODE = 0
313-
Get-Content "selected_l10n_mappings" | ForEach-Object {
314-
$line = $_
315-
Write-Host "Running tests for: $line"
316-
try {
317-
pipenv run python -m l10n_CM.run_l10n --fx-executable="$env:FX_EXECUTABLE" $line
318-
} catch {
319-
$SCRIPT_EXIT_CODE = $_.Exception.HResult
320-
}
321-
}
322-
rm artifacts/assets -r -Force -ErrorAction SilentlyContinue
323-
Get-ChildItem -Path "artifacts" -ErrorAction SilentlyContinue | ForEach-Object {
324-
$destPath = "artifacts-win\" + $_.Name
325-
if (-not (Test-Path -Path $destPath)) {
326-
try {
327-
Move-Item -Path $_.FullName -Destination $destPath
328-
} catch {
329-
# Ignore errors and continue
330-
}
331-
}
332-
}
333-
mkdir artifacts-win -Force
334-
if (-not (Test-Path -Path "artifacts-win\*")) {
335-
New-Item -Path "artifacts-win\placeholder.txt" -ItemType File -Value "no mappings to report."
336-
}
337-
$EXIT_CODE = Get-Content -Path "TEST_EXIT_CODE"
338-
if ($EXIT_CODE -ne 0) {
339-
exit [int]$EXIT_CODE
340-
}
341-
exit $env:SCRIPT_EXIT_CODE
342242
- name: Upload artifacts
343-
if: ${{ always() && github.event_name == 'pull_request' }}
243+
if: ${{ always() && inputs.is_pull_request == true }}
344244
uses: actions/upload-artifact@v4
345245
with:
346246
name: artifacts-win
@@ -367,17 +267,17 @@ jobs:
367267
- name: Download Windows artifact
368268
uses: actions/download-artifact@v4
369269
with:
370-
name: artifacts-win
270+
name: artifacts-win-l10n
371271
path: artifacts-win
372272
- name: Download Linux artifact
373273
uses: actions/download-artifact@v4
374274
with:
375-
name: artifacts-linux
275+
name: artifacts-linux-l10n
376276
path: artifacts-linux
377277
- name: Download MacOS artifact
378278
uses: actions/download-artifact@v4
379279
with:
380-
name: artifacts-mac
280+
name: artifacts-mac-l10n
381281
path: artifacts-mac
382282
- name: List downloaded Windows files
383283
run: ls artifacts-win/

0 commit comments

Comments
 (0)