Skip to content

Commit 0339a31

Browse files
committed
Add PDF test file copy step to deploy workflow
The deploy_github_page workflow now copies test PDF files from test/pdf_file to reports_site/pdf if present. Updated .gitignore to exclude reports_site/pdf/. Increased test timeouts in get-header.test.ts to 30 seconds to prevent timeout failures.
1 parent a636275 commit 0339a31

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

.github/workflows/deploy_github_page.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ jobs:
5454
directory: ./reports_site/coverage
5555
fail_ci_if_error: false
5656

57+
- name: Copy test pdf files into site
58+
run: |
59+
if [ -d test/pdf_file ]; then
60+
mkdir -p reports_site/pdf
61+
cp -r test/pdf_file/* reports_site/pdf/ || true
62+
echo "Copied test/pdf_file -> reports_site/pdf/"
63+
else
64+
echo "No test/pdf_file directory found; skipping copy"
65+
fi
66+
5767
- name: Setup Pages
5868
uses: actions/configure-pages@v5
5969

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,5 @@ test/**/imgs/
156156
test/**/*_images/
157157
dist/
158158
temp/
159+
reports_site/pdf/
159160

test/test-00-get-header/get-header.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, expect, test } from 'vitest';
33
import { getHeader, PDFParse } from '../../src/index';
44

55
describe('get-header test', () => {
6-
test('check bitcoin url', async () => {
6+
test('check bitcoin url', { timeout: 30000 }, async () => {
77
const parser = new PDFParse({ url: 'https://bitcoin.org/bitcoin.pdf' });
88

99
const result = await parser.getHeader();
@@ -13,7 +13,7 @@ describe('get-header test', () => {
1313
expect(result.isPdf).toBe(undefined);
1414
});
1515

16-
test('check bitcoin url, with true param', async () => {
16+
test('check bitcoin url, with true param', { timeout: 30000 }, async () => {
1717
const parser = new PDFParse({ url: 'https://bitcoin.org/bitcoin.pdf' });
1818

1919
const result = await parser.getHeader(true);
@@ -23,15 +23,15 @@ describe('get-header test', () => {
2323
expect(result.isPdf).toBe(true);
2424
});
2525

26-
test('check bitcoin url, getHeader helper', async () => {
26+
test('check bitcoin url, getHeader helper', { timeout: 30000 }, async () => {
2727
const result = await getHeader('https://bitcoin.org/bitcoin.pdf');
2828
expect(result.ok).toBeTruthy();
2929
expect(result.status).toBe(200);
3030
expect(result.size).toBe(184292);
3131
expect(result.isPdf).toBe(undefined);
3232
});
3333

34-
test('check bitcoin url, with true param, getHeader helper', async () => {
34+
test('check bitcoin url, with true param, getHeader helper', { timeout: 30000 }, async () => {
3535
const result = await getHeader('https://bitcoin.org/bitcoin.pdf', true);
3636
expect(result.ok).toBeTruthy();
3737
expect(result.status).toBe(200);

0 commit comments

Comments
 (0)