Skip to content

Commit 35f0591

Browse files
committed
Migrate gh_pages to reports_site and update workflows
Renames the gh_pages directory to reports_site, updates all related paths and references in configuration, documentation, and scripts. Modernizes GitHub Actions workflows to use latest actions and options, improves caching and setup steps, and updates package and dev dependencies. Also updates ignore files, SonarCloud config, and README to reflect new structure.
1 parent 0e7696c commit 35f0591

34 files changed

+150617
-267
lines changed

.github/workflows/deploy_github_page.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,21 @@ jobs:
4747
- name: Site Build
4848
run: npm run site:build
4949

50+
- name: Upload Coverage to Codecov
51+
uses: codecov/codecov-action@v5
52+
with:
53+
token: ${{ secrets.CODECOV_TOKEN }}
54+
directory: ./reports_site/coverage
55+
fail_ci_if_error: false
56+
5057
- name: Setup Pages
5158
uses: actions/configure-pages@v5
5259

5360
- name: Upload static files
5461
uses: actions/upload-pages-artifact@v4
5562
with:
56-
path: gh_pages/
57-
name: report-site
63+
path: reports_site/
64+
name: reports-and-live-demo
5865

5966
deploy:
6067
runs-on: ubuntu-latest
@@ -67,4 +74,4 @@ jobs:
6774
id: deployment
6875
uses: actions/deploy-pages@v4
6976
with:
70-
artifact_name: report-site
77+
artifact_name: reports-and-live-demo

.github/workflows/publish_npm_package.yml

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ jobs:
1919
node-version: [20, 22, 23, 24]
2020

2121
steps:
22-
- uses: actions/checkout@v4
22+
- name: Checkout
23+
uses: actions/checkout@v5
2324
with:
24-
fetch-depth: 0
25+
fetch-depth: 1
26+
show-progress: false
2527

2628
- name: Use Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v4
29+
uses: actions/setup-node@v6
2830
with:
2931
node-version: ${{ matrix.node-version }}
32+
package-manager-cache: false
3033

31-
- name: Clean npm cache
34+
- name: Clean NPM Cache
3235
run: npm cache clean --force
3336

3437
- name: Install
@@ -52,14 +55,16 @@ jobs:
5255
fi
5356
done
5457
55-
deploy-and-publish:
58+
publish:
5659
runs-on: ubuntu-latest
5760
needs: integration_test
5861
environment: publish
5962
steps:
60-
- uses: actions/checkout@v3
63+
- name: Checkout
64+
uses: actions/checkout@v5
6165
with:
62-
fetch-depth: 0
66+
fetch-depth: 1
67+
show-progress: false
6368

6469
- name: Extract tag version
6570
id: tag_version
@@ -83,32 +88,20 @@ jobs:
8388
fi
8489
echo "Version match confirmed: ${{ steps.tag_version.outputs.version }}"
8590
86-
- uses: actions/setup-node@v3
91+
- name: Setup Node.js
92+
uses: actions/setup-node@v6
8793
with:
8894
node-version: "22.20.0"
89-
registry-url: "https://registry.npmjs.org/"
95+
package-manager-cache: false
9096

91-
- name: Clean npm cache
97+
- name: Clean NPM Cache
9298
run: npm cache clean --force
9399

94100
- name: Install
95101
run: npm i
96102

97-
- name: Unit tests & coverage
98-
run: npm run coverage
99-
100-
- name: Upload coverage to Codecov
101-
uses: codecov/codecov-action@v5
102-
with:
103-
token: ${{ secrets.CODECOV_TOKEN }}
104-
directory: ./gh_pages/coverage
105-
fail_ci_if_error: false
106-
107-
- name: Deploy to GitHub Pages
108-
uses: peaceiris/actions-gh-pages@v3
109-
with:
110-
github_token: ${{ secrets.GITHUB_TOKEN }}
111-
publish_dir: ./gh_pages
103+
- name: Unit Tests
104+
run: npm test
112105

113106
- run: npm publish --provenance
114107
env:

.github/workflows/test.yml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,25 @@ permissions:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12-
12+
1313
steps:
14-
- uses: actions/checkout@v3
15-
with:
16-
fetch-depth: 0
17-
18-
- name: Setup Node.js
19-
uses: actions/setup-node@v3
20-
with:
21-
node-version: '22.20.0'
22-
23-
- name: Clean npm cache
24-
run: npm cache clean --force
25-
26-
- name: Install
27-
run: npm i
28-
29-
- name: Unit tests
30-
run: npm test
14+
- name: Checkout
15+
uses: actions/checkout@v5
16+
with:
17+
fetch-depth: 1
18+
show-progress: false
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v6
22+
with:
23+
node-version: "22.20.0"
24+
package-manager-cache: false
25+
26+
- name: Clean NPM Cache
27+
run: npm cache clean --force
28+
29+
- name: Install
30+
run: npm i
31+
32+
- name: Unit tests
33+
run: npm test

.github/workflows/test_integration.yml

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,45 @@ permissions:
77
pull-requests: read
88

99
jobs:
10-
test:
10+
integration_test:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
1414
node-version: [20, 22, 23, 24]
1515

1616
steps:
17-
- uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0
20-
21-
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v4
23-
with:
24-
node-version: ${{ matrix.node-version }}
25-
26-
- name: Clean npm cache
27-
run: npm cache clean --force
28-
29-
- name: Install
30-
run: npm i
31-
32-
- name: Unit tests
33-
run: npm test
34-
35-
- name: Integration tests
36-
run: |
37-
set -euo pipefail
38-
echo "Looking for subfolders in test_integration/..."
39-
for d in test_integration/*; do
40-
if [ -d "$d" ]; then
41-
echo "--- Entering $d ---"
42-
if [ -f "$d/package.json" ]; then
43-
(cd "$d" && npm i && npm test)
44-
else
45-
echo "skipping $d (no package.json)"
17+
- name: Checkout
18+
uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 1
21+
show-progress: false
22+
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v6
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
package-manager-cache: false
28+
29+
- name: Clean NPM Cache
30+
run: npm cache clean --force
31+
32+
- name: Install
33+
run: npm i
34+
35+
- name: Unit tests
36+
run: npm test
37+
38+
- name: Integration tests
39+
run: |
40+
set -euo pipefail
41+
echo "Looking for subfolders in test_integration/..."
42+
for d in test_integration/*; do
43+
if [ -d "$d" ]; then
44+
echo "--- Entering $d ---"
45+
if [ -f "$d/package.json" ]; then
46+
(cd "$d" && npm i && npm test)
47+
else
48+
echo "skipping $d (no package.json)"
49+
fi
4650
fi
47-
fi
48-
done
51+
done

.gitignore

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,11 @@ lib-cov
2222
coverage
2323
*.lcov
2424

25-
# Test and coverage reports
26-
reports/test-report
27-
reports/coverage
28-
reports/benchmark
29-
3025
# Github Pages
31-
gh_pages/test-report
32-
gh_pages/coverage
33-
gh_pages/benchmark
34-
gh_pages/demo/dist-browser
26+
reports_site/test-report
27+
reports_site/coverage
28+
reports_site/benchmark
29+
reports_site/demo/dist-browser
3530

3631
# Temp Example Files
3732
example/browser/dist-browser

.sonarcloud.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sonar.organization=pdf-parse
55
# Path to sources (root of TypeScript sources)
66
sonar.sources=src
77
sonar.inclusions=src/**
8-
sonar.exclusions=**/dist/**,**/node_modules/**,**/test/**,**/*.spec.ts,**/*.test.ts,**/example/**,**test_integration**,**/gh_pages/**
8+
sonar.exclusions=**/dist/**,**/node_modules/**,**/test/**,**/*.spec.ts,**/*.test.ts,**/example/**,**test_integration**,**/reports_site/**
99

1010
# Path to tests
1111
sonar.tests=test
@@ -25,7 +25,7 @@ sonar.cpd.exclusions=**/dist/**,**/node_modules/**
2525
# Coverage report - Vitest with V8 reporter writes lcov to coverage/lcov.info when run via `npm run coverage`
2626
# Ensure your CI generates the coverage report before running sonar-scanner
2727
sonar.coverage.exclusions=**/test/**,**/*.d.ts
28-
sonar.javascript.lcov.reportPaths=./gh_pages/coverage/lcov.info
28+
sonar.javascript.lcov.reportPaths=./reports_site/coverage/lcov.info
2929

3030
# Optional: a link to the repo and CI branch (helpful in PR decoration)
3131
sonar.scm.provider=git

.vscode/extensions.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
{
2-
"recommendations": ["vitest.explorer", "biomejs.biome", "redhat.vscode-yaml"]
2+
"recommendations": [
3+
"vitest.explorer",
4+
"biomejs.biome",
5+
"redhat.vscode-yaml",
6+
"ritwickdey.liveserver"
7+
]
38
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ parser.getText().then((result)=>{
5454
- Well-covered with [`unit tests`](./test)
5555
- [`Integration tests`](./test_integration) to validate end-to-end behavior across environments.
5656
- See [DocumentInitParameters](./README.options.md#documentinitparameters) and [ParseParameters](./README.options.md#parseparameters) for all available options.
57-
- For usage examples, see [`example`](./example), [`test`](./test) and [`test/example`](./test/test-example) folders.
57+
- For usage examples, see [`live_demo`](./reports_site/live_demo/), [`example`](./example/), [`test`](./test/) and [`test/example`](./test/test-example/) folders.
5858

5959

6060
## Installation
@@ -260,7 +260,7 @@ try {
260260
## Web / Browser <a href="https://www.jsdelivr.com/package/npm/pdf-parse" target="_blank"><img align="right" src="https://img.shields.io/jsdelivr/npm/hm/pdf-parse"></a>
261261
- Can be integrated into `React`, `Vue`, `Angular`, or any other web framework.
262262
- **Live Demo:** [`https://mehmet-kozan.github.io/pdf-parse/`](https://mehmet-kozan.github.io/pdf-parse/)
263-
- **Demo Source Code:** [`gh-pages branch`](https://github.com/mehmet-kozan/pdf-parse/tree/gh-pages)
263+
- **Demo Source:** [`reports_site/live_demo`](reports_site/live_demo)
264264
265265
### CDN Usage
266266

biome.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.2.6/schema.json",
33
"vcs": {
44
"enabled": true,
55
"clientKind": "git",
66
"useIgnoreFile": true
77
},
88
"files": {
99
"ignoreUnknown": true,
10-
"includes": ["**", "!dist", "!gh_pages/demo/dist-browser", "!gh_pages/test-report", "!gh_pages/coverage", "!gh_pages/benchmark"]
10+
"includes": ["**", "!dist", "!reports_site/live_demo/dist-browser", "!reports_site/test-report", "!reports_site/coverage", "!reports_site/benchmark"]
1111
},
1212
"formatter": {
1313
"enabled": true,

0 commit comments

Comments
 (0)