Skip to content

Commit 9d708a7

Browse files
add linux to workflow run
1 parent 8aecda8 commit 9d708a7

File tree

3 files changed

+80
-50
lines changed

3 files changed

+80
-50
lines changed

.github/workflows/check-beta.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
mac_reportable: ${{ steps.reportable.outputs.mac }}
1717
mac_l10n_reportable: ${{ steps.reportable.outputs.mac_l10n }}
1818
win_l10n_reportable: ${{ steps.reportable.outputs.win_l10n }}
19+
linux_l10n_reportable: ${{ steps.reportable.outputs.linux_l10n }}
1920
steps:
2021
- name: Checkout repository
2122
uses: actions/checkout@v4
@@ -42,6 +43,7 @@ jobs:
4243
run: |
4344
echo win_l10n=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Windows"))') >> "$GITHUB_OUTPUT"
4445
echo mac_l10n=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Darwin"))') >> "$GITHUB_OUTPUT"
46+
echo linux_l10n=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Linux"))') >> "$GITHUB_OUTPUT"
4547
4648
Run-Win-Smoke:
4749
needs: Check-Beta-Version
@@ -73,4 +75,12 @@ jobs:
7375
uses: ./.github/workflows/l10n.yml
7476
with:
7577
job_to_run: L10N-Windows
78+
secrets: inherit
79+
80+
Run-L10N-Linux-Smoke:
81+
needs: Check-Beta-Version
82+
if: ${{ needs.Check-Beta-Version.outputs.linux_l10n_reportable == 'True' }}
83+
uses: ./.github/workflows/l10n.yml
84+
with:
85+
job_to_run: L10N-Linux
7686
secrets: inherit

.github/workflows/l10n.yml

Lines changed: 58 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ env:
3737

3838
jobs:
3939
L10N-MacOS:
40-
if: ${{ inputs.job_to_run == 'L10N-MacOS' || inputs.mac_installer_link }}
40+
if: ${{ github.event_name == 'pull_request' || inputs.job_to_run == 'L10N-MacOS' || inputs.mac_installer_link }}
4141
runs-on: macos-latest
4242
steps:
4343
- name: Create app token
@@ -71,57 +71,57 @@ jobs:
7171
pip3 install 'ruff>=0.4.8,<0.5';
7272
rm ./pyproject.toml;
7373
mv ./ci_pyproject.toml ./pyproject.toml;
74-
pipenv install
74+
pipenv install;
7575
- name: Install Fx
7676
id: setup
7777
env:
7878
MANUAL_DOWNLOAD_LINK: ${{ inputs.mac_installer_link }}
7979
run:
80-
echo app_name=$(bash ./collect_executables.sh | xargs -0 ./parse_executables.sh) >> "$GITHUB_OUTPUT"
80+
echo app_name=$(bash ./collect_executables.sh | xargs -0 ./parse_executables.sh) >> "$GITHUB_OUTPUT";
8181
- name: Run L10N Tests in MacOS
8282
if: steps.setup.conclusion == 'success'
8383
env:
8484
FX_EXECUTABLE: /Volumes/${{ steps.setup.outputs.app_name }}/${{ steps.setup.outputs.app_name }}.app/Contents/MacOS/firefox
8585
run: |
86-
"$FX_EXECUTABLE" --version
87-
echo "0" > TEST_EXIT_CODE
88-
pipenv run python check_l10n_test_cases.py
86+
"$FX_EXECUTABLE" --version;
87+
echo "0" > TEST_EXIT_CODE;
88+
pipenv run python check_l10n_test_cases.py;
8989
while IFS= read -r line; do
90-
echo "Running tests for: $line"
91-
pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?
92-
done < selected_l10n_mappings
93-
mv artifacts artifacts-mac || true
94-
EXIT_CODE=$(cat TEST_EXIT_CODE)
90+
echo "Running tests for: $line";
91+
pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
92+
done < selected_l10n_mappings;
93+
mv artifacts artifacts-mac || true;
94+
EXIT_CODE=$(cat TEST_EXIT_CODE);
9595
if [ $EXIT_CODE != 0 ]; then
96-
exit $EXIT_CODE
96+
exit $EXIT_CODE;
9797
fi
98-
exit $SCRIPT_EXIT_CODE
98+
exit $SCRIPT_EXIT_CODE;
9999
- name: Run L10N Tests in MacOS (Headed)
100100
if: steps.setup.conclusion == 'success' && always()
101101
env:
102102
FX_EXECUTABLE: /Volumes/${{ steps.setup.outputs.app_name }}/${{ steps.setup.outputs.app_name }}.app/Contents/MacOS/firefox
103103
REPORTABLE: ${{ env.TESTRAIL_REPORT == 'true' }}
104104
run: |
105105
mv ./ci_l10n_pyproject_headed.toml ./pyproject.toml;
106-
echo "0" > TEST_EXIT_CODE
106+
echo "0" > TEST_EXIT_CODE;
107107
while IFS= read -r line; do
108-
echo "Running tests for: $line"
109-
pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?
110-
done < selected_l10n_mappings
111-
mv -n artifacts/* artifacts-mac/ || true
112-
EXIT_CODE=$(cat TEST_EXIT_CODE)
108+
echo "Running tests for: $line";
109+
pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
110+
done < selected_l10n_mappings;
111+
mv -n artifacts/* artifacts-mac/ || true;
112+
EXIT_CODE=$(cat TEST_EXIT_CODE);
113113
if [ $EXIT_CODE != 0 ]; then
114-
exit $EXIT_CODE
114+
exit $EXIT_CODE;
115115
fi
116-
exit $SCRIPT_EXIT_CODE
116+
exit $SCRIPT_EXIT_CODE;
117117
- name: Upload artifacts
118118
if: ${{ always() && github.event_name == 'pull_request' }}
119119
uses: actions/upload-artifact@v4
120120
with:
121121
name: artifacts-mac
122122
path: artifacts-mac
123123
L10N-Linux:
124-
if: ${{ inputs.linux_tarball_link }}
124+
if: ${{ github.event_name == 'pull_request' || inputs.job_to_run == 'L10N-Linux' || inputs.linux_tarball_link }}
125125
runs-on: ubuntu-latest
126126
steps:
127127
- name: Create app token
@@ -145,58 +145,60 @@ jobs:
145145
run: |
146146
echo "MANUAL='true'" >> "$GITHUB_ENV";
147147
echo "Running l10n tests on supplied executable";
148-
sudo apt install gnome-screenshot
148+
sudo apt install gnome-screenshot;
149149
uname -m;
150150
mkdir -p artifacts;
151151
pip3 install 'pipenv==2023.11.15';
152152
pip3 install 'ruff>=0.4.8,<0.5';
153153
rm ./pyproject.toml;
154154
mv ./ci_xvfb_pyproject.toml ./pyproject.toml;
155155
pipenv install;
156-
./collect_executables.sh
156+
./collect_executables.sh;
157157
./firefox/firefox --version;
158-
#. ./keyring-unlock.sh;
159158
- name: Run L10N Tests in Ubuntu
160159
if: steps.setup.conclusion == 'success'
161160
env:
162161
FX_EXECUTABLE: ./firefox/firefox
163162
run: |
164-
"$FX_EXECUTABLE" --version
165-
echo "0" > TEST_EXIT_CODE
166-
pipenv run python check_l10n_test_cases.py
163+
"$FX_EXECUTABLE" --version;
164+
echo "0" > TEST_EXIT_CODE;
165+
pipenv run python check_l10n_test_cases.py;
167166
Xvfb :99 -screen 0 '1600x1200x24' > artifacts/xvfb.log &
168167
while IFS= read -r line; do
169-
echo "Running tests for: $line"
170-
DISPLAY=:99 pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?
171-
done < selected_l10n_mappings
172-
mv artifacts artifacts-mac || true
173-
EXIT_CODE=$(cat TEST_EXIT_CODE)
168+
echo "Running tests for: $line";
169+
DISPLAY=:99 pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
170+
done < selected_l10n_mappings;
171+
mv artifacts artifacts-linux || true;
172+
EXIT_CODE=$(cat TEST_EXIT_CODE);
174173
if [ $EXIT_CODE != 0 ]; then
175-
exit $EXIT_CODE
174+
exit $EXIT_CODE;
176175
fi
177-
exit $SCRIPT_EXIT_CODE
176+
exit $SCRIPT_EXIT_CODE;
178177
- name: Run Smoke Tests in Ubuntu (Headed)
179178
if: steps.setup.conclusion == 'success' && always()
180179
env:
181180
FX_EXECUTABLE: ./firefox/firefox
182181
run: |
183182
mv ./ci_xvfb_pyproject_headed.toml ./pyproject.toml;
184-
echo "0" > TEST_EXIT_CODE
183+
echo "0" > TEST_EXIT_CODE;
185184
while IFS= read -r line; do
186-
echo "Running tests for: $line"
187-
DISPLAY=:99 pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?
188-
done < selected_l10n_mappings
189-
mv -n artifacts/* artifacts-mac/ || true
190-
EXIT_CODE=$(cat TEST_EXIT_CODE)
185+
echo "Running tests for: $line";
186+
DISPLAY=:99 pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
187+
done < selected_l10n_mappings;
188+
mv -n artifacts/* artifacts-linux/ || true;
189+
EXIT_CODE=$(cat TEST_EXIT_CODE);
191190
if [ $EXIT_CODE != 0 ]; then
192-
exit $EXIT_CODE
191+
exit $EXIT_CODE;
193192
fi
194-
exit $SCRIPT_EXIT_CODE
195-
196-
197-
193+
exit $SCRIPT_EXIT_CODE;
194+
- name: Upload artifacts
195+
if: ${{ always() && github.event_name == 'pull_request' }}
196+
uses: actions/upload-artifact@v4
197+
with:
198+
name: artifacts-linux
199+
path: artifacts-linux
198200
L10N-Windows:
199-
if: ${{ inputs.job_to_run == 'L10N-Windows' || inputs.win_installer_link }}
201+
if: ${{ github.event_name == 'pull_request' || inputs.job_to_run == 'L10N-Windows' || inputs.win_installer_link }}
200202
runs-on: windows-latest
201203
steps:
202204
- name: Create app token
@@ -338,6 +340,7 @@ jobs:
338340
needs:
339341
- L10N-Windows
340342
- L10N-MacOS
343+
- L10N-Linux
341344
steps:
342345
- name: Checkout repository
343346
uses: actions/checkout@v4
@@ -354,13 +357,20 @@ jobs:
354357
with:
355358
name: artifacts-win
356359
path: artifacts-win
360+
- name: Download Windows artifact
361+
uses: actions/download-artifact@v4
362+
with:
363+
name: artifacts-linux
364+
path: artifacts-linux
357365
- name: Download MacOS artifact
358366
uses: actions/download-artifact@v4
359367
with:
360368
name: artifacts-mac
361369
path: artifacts-mac
362-
- name: List downloaded files
370+
- name: List downloaded Windows files
363371
run: ls artifacts-win/
372+
- name: List downloaded Linux files
373+
run: ls artifacts-linux/
364374
- name: List downloaded MacOS files
365375
run: ls artifacts-mac/
366376
- name: Run script with secret

notifier.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,13 @@ def list_and_write(source_directory: str, links: List[str]):
7474
f.write(contents)
7575

7676

77-
def compile_link_file(links_win: List[str], links_mac: List[str]):
77+
def compile_link_file(
78+
links_win: List[str], links_mac: List[str], links_linux: List[str] = []
79+
):
7880
print("Compiling the current artifact link file...")
7981
links_mac.sort()
8082
links_win.sort()
83+
links_linux.sort()
8184

8285
output_file_path = os.path.join(time_now, "full_report.txt")
8386
content_type = get_content_type(output_file_path)
@@ -94,12 +97,18 @@ def compile_link_file(links_win: List[str], links_mac: List[str]):
9497

9598
for url in links_mac:
9699
f.write(url + "\n")
100+
101+
f.write("\nLinux Artifacts:\n\n")
102+
103+
for url in links_linux:
104+
f.write(url + "\n")
97105
return f"{root_url}{time_now}/full_report.txt"
98106

99107

100108
time_now = get_current_timestamp()
101109
links_win = []
102110
links_mac = []
111+
links_linux = []
103112
root_url = "https://storage.googleapis.com/notifier-artifact-bucket/"
104113
report_file = ""
105114

@@ -114,12 +123,13 @@ def compile_link_file(links_win: List[str], links_mac: List[str]):
114123
bucket = storage_client.bucket(bucket_name)
115124
list_and_write("artifacts-mac", links_mac)
116125
list_and_write("artifacts-win", links_win)
126+
list_and_write("artifacts-linux", links_linux)
117127
except Exception as e:
118128
print("The artifact upload process ran into some issues: ", e)
119129

120130

121131
try:
122-
report_file = compile_link_file(links_win, links_mac)
132+
report_file = compile_link_file(links_win, links_mac, links_linux)
123133
except Exception as e:
124134
print(f"The link compilation had some issues: {e}")
125135

0 commit comments

Comments
 (0)