File tree Expand file tree Collapse file tree 5 files changed +34
-10
lines changed Expand file tree Collapse file tree 5 files changed +34
-10
lines changed Original file line number Diff line number Diff line change
1
+ # NOTE: In contrast to Linux and macOS, the Windows build machines do not have Chrome installed.
2
+
1
3
name : " HTML2PDF on Windows"
2
4
3
- # FIXME: Disabled until WDM detects Chrome on Windows reliably.
4
- # on:
5
- # pull_request:
6
- # branches: [ "**" ]
5
+ on :
6
+ pull_request :
7
+ branches : [ "**" ]
7
8
8
9
jobs :
9
10
build :
21
22
with :
22
23
python-version : ${{ matrix.python-version }}
23
24
25
+ - name : Install Google Chrome
26
+ run : |
27
+ choco install googlechrome --no-progress -y
28
+ shell : powershell
29
+
30
+ - name : Check Chrome Version
31
+ run : ' & "C:\Program Files\Google\Chrome\Application\chrome.exe" --version'
32
+ shell : powershell
33
+
34
+ - name : Add Chrome to PATH
35
+ run : |
36
+ $chromePath = "C:\Program Files\Google\Chrome\Application"
37
+ echo "Adding $chromePath to PATH"
38
+ echo "$chromePath" | Out-File -Append -Encoding utf8 $env:GITHUB_PATH
39
+ shell : powershell
40
+
41
+ - name : Verify Chrome Installation
42
+ run : chrome --version
43
+ shell : powershell
44
+
24
45
- name : Upgrade pip
25
46
run : |
26
47
python -m pip install --upgrade pip
Original file line number Diff line number Diff line change @@ -265,8 +265,11 @@ def exit_handler():
265
265
print ("html2pdf: exit handler: quitting the ChromeDriver." ) # noqa: T201
266
266
driver .quit ()
267
267
268
- for separate_path_pair_ in paths :
269
- path_to_input_html , path_to_output_pdf = separate_path_pair_ .split (":" )
268
+ assert len (paths ) % 2 == 0 , f"Expecting an even number of input/output path arguments: { paths } ."
269
+ for current_pair_idx in range (0 , 2 , len (paths )):
270
+ path_to_input_html = paths [current_pair_idx ]
271
+ path_to_output_pdf = paths [current_pair_idx + 1 ]
272
+
270
273
assert os .path .isfile (path_to_input_html ), path_to_input_html
271
274
272
275
path_to_output_pdf_dir = os .path .dirname (path_to_output_pdf )
Original file line number Diff line number Diff line change 1
- RUN: %html2pdf %S/index.html: %S/Output/index.pdf
1
+ RUN: %html2pdf %S/index.html %S/Output/index.pdf
2
2
3
3
RUN: %check_exists --file "%S/Output/index.pdf"
4
4
RUN: python %S/test.py
Original file line number Diff line number Diff line change 1
- RUN: %html2pdf %S/index.html: %S/Output/index.pdf
1
+ RUN: %html2pdf %S/index.html %S/Output/index.pdf
2
2
3
3
RUN: %check_exists --file "%S/Output/index.pdf"
4
4
RUN: python %S/test.py
Original file line number Diff line number Diff line change 1
- RUN: %html2pdf --cache-dir %S/Output/cache %S/index.html: %S/Output/index.pdf | filecheck %s --dump-input=fail --check-prefix CHECK-RUN1
1
+ RUN: %html2pdf --cache-dir %S/Output/cache %S/index.html %S/Output/index.pdf | filecheck %s --dump-input=fail --check-prefix CHECK-RUN1
2
2
RUN: %check_exists --file "%S/Output/index.pdf"
3
3
RUN: python %S/test.py
4
4
5
5
CHECK-RUN1: html2pdf: ChromeDriver does not exist in the local cache:
6
6
7
- RUN: %html2pdf --cache-dir %S/Output/cache %S/index.html: %S/Output/index.pdf | filecheck %s --dump-input=fail --check-prefix CHECK-RUN2
7
+ RUN: %html2pdf --cache-dir %S/Output/cache %S/index.html %S/Output/index.pdf | filecheck %s --dump-input=fail --check-prefix CHECK-RUN2
8
8
RUN: %check_exists --file "%S/Output/index.pdf"
9
9
RUN: python %S/test.py
10
10
You can’t perform that action at this time.
0 commit comments