diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index a33d24283..68e102a65 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - hotfix paths-ignore: - "apps/website/**" pull_request: @@ -13,8 +14,24 @@ permissions: contents: read jobs: - main: - runs-on: ubuntu-latest + e2e: + strategy: + fail-fast: false + matrix: + include: + - name: linux-x64 + os: ubuntu-22.04 + arch: x64 + - name: linux-arm64 + os: ubuntu-24.04-arm + arch: arm64 + runs-on: ${{ matrix.os }} + name: E2E tests on ${{ matrix.name }} + env: + TRILIUM_DOCKER: 1 + TRILIUM_PORT: 8082 + TRILIUM_DATA_DIR: "${{ github.workspace }}/apps/server/spec/db" + TRILIUM_INTEGRATION_TEST: memory steps: - uses: actions/checkout@v5 with: @@ -29,9 +46,34 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - run: pnpm exec playwright install --with-deps - - run: pnpm --filter server-e2e e2e + - name: Install Playwright browsers + run: pnpm exec playwright install --with-deps + + - name: Build the server + uses: ./.github/actions/build-server + with: + os: linux + arch: ${{ matrix.arch }} + + - name: Unpack and start the server + run: | + version=$(node --eval "console.log(require('./package.json').version)") + file=$(find ./upload -name '*.tar.xz' -print -quit) + name=$(basename "$file" .tar.xz) + mkdir -p ./server-dist + tar -xvf "$file" -C ./server-dist + server_dir="./server-dist/TriliumNotes-Server-$version-linux-${{ matrix.arch }}" + if [ ! -d "$server_dir" ]; then + echo Missing dir. + exit 1 + fi + cd "$server_dir" + "./trilium.sh" & + sleep 10 + + - name: Server end-to-end tests + run: pnpm --filter server-e2e e2e - name: Upload test report if: failure() @@ -39,3 +81,7 @@ jobs: with: name: e2e report path: apps/server-e2e/test-output + + - name: Kill the server + if: always() + run: pkill -f trilium || true diff --git a/apps/client/package.json b/apps/client/package.json index a84bda4c3..b810333be 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -1,6 +1,6 @@ { "name": "@triliumnext/client", - "version": "0.99.4", + "version": "0.99.5", "description": "JQuery-based client for TriliumNext, used for both web and desktop (via Electron)", "private": true, "license": "AGPL-3.0-only", diff --git a/apps/client/src/services/syntax_highlight.ts b/apps/client/src/services/syntax_highlight.ts index 89dc7c94e..dd2bd48b4 100644 --- a/apps/client/src/services/syntax_highlight.ts +++ b/apps/client/src/services/syntax_highlight.ts @@ -24,7 +24,9 @@ export async function formatCodeBlocks($container: JQuery) { continue; } - applyCopyToClipboardButton($(codeBlock)); + if (glob.device !== "print") { + applyCopyToClipboardButton($(codeBlock)); + } if (syntaxHighlightingEnabled) { applySingleBlockSyntaxHighlight($(codeBlock), normalizedMimeType); diff --git a/apps/client/src/widgets/collections/calendar/api.ts b/apps/client/src/widgets/collections/calendar/api.ts index 934edcb2e..eef391108 100644 --- a/apps/client/src/widgets/collections/calendar/api.ts +++ b/apps/client/src/widgets/collections/calendar/api.ts @@ -58,8 +58,6 @@ export async function changeEvent(note: FNote, { startDate, endDate, startTime, startAttribute = note.getAttributes("label").filter(attr => attr.name == "calendar:startTime").shift()?.value||"startTime"; endAttribute = note.getAttributes("label").filter(attr => attr.name == "calendar:endTime").shift()?.value||"endTime"; - if (startTime && endTime) { - setAttribute(note, "label", startAttribute, startTime); - setAttribute(note, "label", endAttribute, endTime); - } + setAttribute(note, "label", startAttribute, startTime); + setAttribute(note, "label", endAttribute, endTime); } diff --git a/apps/client/src/widgets/dialogs/popup_editor.ts b/apps/client/src/widgets/dialogs/popup_editor.ts index 63462f082..80f8f5915 100644 --- a/apps/client/src/widgets/dialogs/popup_editor.ts +++ b/apps/client/src/widgets/dialogs/popup_editor.ts @@ -7,6 +7,11 @@ import Container from "../containers/container.js"; const TPL = /*html*/`\