Skip to content

Commit

Permalink
Provide import test
Browse files Browse the repository at this point in the history
  • Loading branch information
cmahnke committed Nov 23, 2024
1 parent 970bdec commit ea89d1b
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,28 @@ jobs:
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
node-version-file: '.nvmrc'
registry-url: "https://npm.pkg.github.com"
- run: npm ci
- run: npm run lint
- run: npm run format
- run: npx tsc -b --verbose
- run: npx rollup --config
- run: npm run build

import_test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: "https://npm.pkg.github.com"
- name: Install dependencies
run: |
cd tests
cd import
npm i --prefix ./
npm run build
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
1 change: 1 addition & 0 deletions tests/import/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock.json
9 changes: 9 additions & 0 deletions tests/import/import.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Uint16Image, checkHDR, checkHDRCanvas, initHDRCanvas, defaultGetContextHDR, resetGetContext } from "hdr-canvas";

Check failure on line 1 in tests/import/import.ts

View workflow job for this annotation

GitHub Actions / lint

'Uint16Image' is defined but never used
import HDRWebGPUBackend from 'hdr-canvas/three/HDRWebGPUBackend.js';

Check failure on line 2 in tests/import/import.ts

View workflow job for this annotation

GitHub Actions / lint

'HDRWebGPUBackend' is defined but never used
import HDRWebGPURenderer from 'hdr-canvas/three/HDRWebGPURenderer.js';

Check failure on line 3 in tests/import/import.ts

View workflow job for this annotation

GitHub Actions / lint

'HDRWebGPURenderer' is defined but never used

window.checkHDR = checkHDR;
window.checkHDRCanvas = checkHDRCanvas;
window.initHDRCanvas = initHDRCanvas;
window.defaultGetContextHDR = defaultGetContextHDR;
window.resetGetContext = resetGetContext;
3 changes: 3 additions & 0 deletions tests/import/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

npm i --prefix ./
11 changes: 11 additions & 0 deletions tests/import/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"dependencies": {
"hdr-canvas": "git+https://github.com/cmahnke/hdr-canvas.git"
},
"devDependencies": {
"esbuild": "^0.24.0"
},
"scripts": {
"build": "esbuild --bundle import.ts"
}
}

0 comments on commit ea89d1b

Please sign in to comment.