Skip to content

Commit

Permalink
build: configure pnpm workspace
Browse files Browse the repository at this point in the history
And remove some unused top level configuration files.

itkConfig.js is out.

ci: update for pnpm workspace
  • Loading branch information
thewtex committed Dec 12, 2023
1 parent 332f8d5 commit 057f5af
Show file tree
Hide file tree
Showing 154 changed files with 2,389 additions and 55,441 deletions.
12 changes: 0 additions & 12 deletions .babelrc

This file was deleted.

76 changes: 57 additions & 19 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,98 @@
name: Cypress Tests
name: Browser Tests

on: [push,pull_request]

defaults:
run:
shell: bash -leo pipefail {0} {0}

jobs:

test-cypress:
name: itk-wasm browser tests
runs-on: ubuntu-22.04
strategy:
max-parallel: 3
matrix:
package: [compress-stringify, compare-images, dicom]

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

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
large-packages: false

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18.16'
node-version: '20'

- name: Install
uses: pnpm/action-setup@v2
with:
version: 8
run_install: true

- name: Build itk-wasm
run: |
pnpm run --aggregate-output --filter itk-wasm build
- name: Build build:gen:typescript
run: |
pnpm run --aggregate-output --filter "@itk-wasm/${{ matrix.package }}-build..." build:gen:typescript
- name: Build typescript
run: |
npm ci
pnpm install
# Build the generated TypeScript package
pnpm run --aggregate-output --filter "@itk-wasm/${{ matrix.package }}..." build:tsc
pnpm run --aggregate-output --filter "@itk-wasm/${{ matrix.package }}" build
- name: Build
- name: Download test data
run: |
npm run build
pnpm run --aggregate-output --filter "@itk-wasm/${{ matrix.package }}-build" test:data:download
- name: Test with Chrome
uses: cypress-io/github-action@v6
with:
browser: chrome
command: npm run test:chrome
working-directory: packages/${{ matrix.package }}/typescript
install: false
start: pnpm start
config: video=true

- uses: actions/upload-artifact@v3
if: failure()
- name: Test itk-wasm with Chrome
uses: cypress-io/github-action@v6
with:
name: cypress-screenshots
path: cypress/screenshots
browser: chrome
working-directory: packages/core/typescript/itk-wasm
install: false
start: pnpm start
config: video=true
wait-on: 'http://localhost:5173'
wait-on-timeout: 360

- uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: cypress/videos
path: packages/${{ matrix.package }}/typescript/cypress/videos
if-no-files-found: ignore

#- name: Test with Firefox
#uses: cypress-io/github-action@v6
#with:
#browser: firefox
#command: npm run test:firefox
- name: Test with Firefox
if: ${{ matrix.package != 'dicom' }}
uses: cypress-io/github-action@v6
with:
browser: firefox
working-directory: packages/${{ matrix.package }}/typescript
install: false
start: pnpm start

- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
path: packages/${{ matrix.package }}/typescript/cypress/screenshots
if-no-files-found: ignore
19 changes: 0 additions & 19 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,25 +160,6 @@ jobs:
run: |
npm run test
test-umd-example:
name: umd
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
large-packages: false

- name: Test
uses: cypress-io/github-action@v6
with:
working-directory: ./examples/umd
browser: chrome
start: npm start

test-webpack-example:
name: webpack
runs-on: ubuntu-22.04
Expand Down
62 changes: 36 additions & 26 deletions .github/workflows/javascript-typescript.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
name: JavaScript,TypeScript
name: Node.js Tests

on: [push,pull_request]

defaults:
run:
shell: bash -leo pipefail {0} {0}

jobs:
build-test-deploy:
runs-on: ubuntu-22.04
strategy:
max-parallel: 3
matrix:
package: [compress-stringify, compare-images, dicom]

steps:
- uses: actions/checkout@v3
Expand All @@ -16,44 +24,46 @@ jobs:
run: |
./src/docker/pull.sh
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18.16'
node-version: '20'

- name: Install packages
run: |
npm ci
- name: Install
uses: pnpm/action-setup@v2
with:
version: 8
run_install: true

- name: Build
- name: Build itk-wasm
run: |
npm run build
pnpm run --aggregate-output --filter itk-wasm build
- name: Lint tests
- name: Build build:gen:typescript
run: |
npm run test:lint
pnpm run --aggregate-output --filter "@itk-wasm/${{ matrix.package }}-build..." build:gen:typescript
- name: Node tests
- name: Build typescript
run: |
npm run test:node
pnpm install
# Build the generated TypeScript package
pnpm run --aggregate-output --filter "@itk-wasm/${{ matrix.package }}..." build:tsc
pnpm run --aggregate-output --filter "@itk-wasm/${{ matrix.package }}" build
- name: Browser tests
- name: Download test data
run: |
# Allow writing test/output.html
sudo chmod 777 test
# To debug locally, run `./test/run.sh -d`
./test/run.sh
pnpm run --aggregate-output --filter "@itk-wasm/${{ matrix.package }}-build" test:data:download
- name: Test building a pipeline
- name: Lint tests
run: |
cd test/pipelines/median-filter-pipeline
node ../../../src/itk-wasm-cli.js build -i itkwasm/emscripten:latest .
rm -rf emscripten-build
pnpm run test:lint
node ../../../src/itk-wasm-cli.js build -i itkwasm/wasi:latest .
rm -rf emscripten-build
- name: Node tests
run: |
pnpm run --aggregate-output --filter "@itk-wasm/${{ matrix.package }}" test:node
cd -
- name: itk-wasm Node tests
run: |
pnpm run --aggregate-output --filter "itk-wasm" test:node
- name: Publish task
env:
Expand All @@ -62,4 +72,4 @@ jobs:
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "itk+community@discourse.itk.org"
npx semantic-release
# todo: use changeset / pnpm publish
9 changes: 7 additions & 2 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm ci

- run: |
npm i -g pnpm
pnpm i
- name: Lint commits
run: npx commitlint --from=${{ github.event.pull_request.base.sha }}
run: pnpx commitlint --from=${{ github.event.pull_request.base.sha }}
Loading

0 comments on commit 057f5af

Please sign in to comment.