Skip to content
Merged
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
3 changes: 0 additions & 3 deletions .Rprofile

This file was deleted.

5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true linguist-vendored -diff

yarn.lock text merge=union linguist-vendored linguist-generated
package-lock.json text merge=union linguist-vendored linguist-generated
49 changes: 49 additions & 0 deletions .github/workflows/test-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Notebook Tests

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ui-tests:
name: Playwright UI tests
runs-on: ubuntu-latest
env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/playwright/browsers
PLAYWRIGHT_HTML_OUTPUT_DIR: ${{ github.workspace }}/playwright/report
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.6
with:
pixi-version: v0.69.0
cache: true
environments: dev
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Install UI test dependencies
run: pixi run install-ui-tests-deps
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
key: playwright-${{ runner.os }}-${{ hashFiles('ui-tests/package-lock.json') }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pixi run install-browsers
- name: Run UI tests
run: pixi run test-ui --reporter=github,html
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: ${{ env.PLAYWRIGHT_HTML_OUTPUT_DIR }}
retention-days: 30
31 changes: 18 additions & 13 deletions .github/workflows/ci.yml → .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: Test and linters

on:
push:
Expand All @@ -11,6 +11,22 @@ concurrency:
cancel-in-progress: true

jobs:
checks:
name: Code checks and formatters
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.6
with:
pixi-version: v0.69.0
cache: true
environments: dev
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Check linters and formatting
run: pixi run pre-commit-all

test:
name: R unit tests
runs-on: ${{ matrix.os }}
Expand All @@ -28,18 +44,7 @@ jobs:
cache: true
environments: dev
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Check linters and formatting
run: pixi run pre-commit-all
- name: Run unit tests
run: pixi run test
- name: Run example notebook
run: |
pixi run serve-jupyter nbconvert \
--to notebook \
--execute \
--ExecutePreprocessor.store_widget_state=False \
--output "${PWD}/out.ipynb" \
examples/widgets.ipynb

# Widgets did render successufully as mime bundle
grep 'application/vnd.jupyter.ywidget-view+json' "${PWD}/out.ipynb"
run: pixi run test-example
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,19 @@ rsconnect/

# Pixi
.pixi/

# Integration tests
ui-tests/test-results/
ui-tests/playwright-report/

# Web files
node_modules/
*.log
.eslintcache
.stylelintcache

# Jupyter assets
.ipynb_checkpoints

# nbconvert tests
examples/*.nbconvert.ipynb
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ repos:
- id: check-toml
- id: check-merge-conflict
- id: mixed-line-ending
- repo: https://github.com/kynan/nbstripout
rev: 0.9.1
hooks:
- id: nbstripout
- repo: local
hooks:
- id: pixi-doc
Expand All @@ -22,6 +26,12 @@ repos:
language: system
types_or: [r]
pass_filenames: false
- id: pixi-biome-format
name: "Run Biome format through pixi"
entry: pixi run fmt-biome""
language: system
types_or: [javascript, jsx, ts, tsx, json, css]
exclude: "(^|/)package\\.json$"
- id: pixi-check-typos
name: "Run typos through pixi"
entry: pixi run check-typos
Expand Down
62 changes: 62 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"files": {
"includes": [
"**",
"!**/node_modules/**/*",
"!**/package.json",
"!.yarn/**/*",
"!.pixi/**/*",
"!.vscode/**/*",
"!coverage/**/*"
]
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": {
"level": "on",
"options": {
"groups": [
{
"type": false,
"source": ":PACKAGE:"
},
{
"type": true,
"source": ":PACKAGE:"
},
":BLANK_LINE:",
{
"type": false,
"source": ":PATH:"
},
{
"type": true,
"source": ":PATH:"
}
]
}
}
}
}
},
"formatter": {
"formatWithErrors": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"linter": {
"enabled": true,
"rules": {
"style": {
"noDefaultExport": "off",
"noNonNullAssertion": "off"
},
"suspicious": {
"noConsole": "off"
}
}
}
}
10 changes: 10 additions & 0 deletions dev/.Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Dev startup profile: load the in-tree package with devtools.
# Loaded via R_PROFILE_USER (see pixi tasks), so resolve the package root from
# this file's own location.
local({
root <- dirname(dirname(normalizePath(Sys.getenv("R_PROFILE_USER")))) # dev/.Rprofile -> dev -> root

if (requireNamespace("devtools", quietly = TRUE)) {
try(devtools::load_all(root, quiet = TRUE))
}
})
Loading
Loading