Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed .yml build error caused by ternary in script name for e2e-node #2690

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wicked-jeans-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-pdf/pdfkit": patch
---

fix: jpeg precision metadata
13 changes: 5 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,16 @@ jobs:

- name: Run tests
run: REACT_VERSION=${{ matrix.react_version }} yarn test

e2e-node:
name: Run E2E tests (Node.js ${{ matrix.node_version }}; ${{ matrix.cjs_or_esm == 'cjs' ? 'CJS' : 'ESM' }})
name: Run E2E tests (Node.js ${{ matrix.node_version }}; ${{ matrix.cjs_or_esm }})
runs-on: ubuntu-latest
strategy:
matrix:
cjs_or_esm: [cjs, esm]
node_version: [18, 20, 21]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cache Yarn cache
uses: actions/cache@v4
env:
Expand All @@ -128,14 +125,14 @@ jobs:
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}

- name: Install dependencies and build
run: yarn --frozen-lockfile

- name: Run E2E tests
run: yarn --cwd e2e/node-${{ matrix.cjs_or_esm }} run start
run: |
FORMAT_UPPERCASE=$(echo "${{ matrix.cjs_or_esm }}" | tr '[:lower:]' '[:upper:]')
echo "Running E2E tests in $FORMAT_UPPERCASE mode"
yarn --cwd e2e/node-${{ matrix.cjs_or_esm }} run start
1 change: 1 addition & 0 deletions packages/pdfkit/src/image/jpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class JPEG {
}

if (marker.name === 'SOF') {
this.bits ||= marker.precision;
this.width ||= marker.width;
this.height ||= marker.height;
this.colorSpace ||= COLOR_SPACE_MAP[marker.numberOfComponents];
Expand Down
Loading