fix(nix): make flake more robust, reduce log spam (#10661) #11289
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: playwright | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - hotfix | |
| paths-ignore: | |
| - "docs/**" | |
| - "*.md" | |
| - "LICENSE" | |
| - ".github/workflows/mobile.yml" | |
| - "apps/web-clipper/**" | |
| - "apps/website/**" | |
| - "apps/db-compare/**" | |
| - "apps/dump-db/**" | |
| - "apps/edit-docs/**" | |
| - "apps/build-docs/**" | |
| - "apps/icon-pack-builder/**" | |
| - "apps/client/src/translations/**" | |
| - "apps/server/src/assets/translations/**" | |
| pull_request: | |
| paths-ignore: | |
| - "docs/**" | |
| - "*.md" | |
| - "LICENSE" | |
| - ".github/workflows/mobile.yml" | |
| - "apps/web-clipper/**" | |
| - "apps/website/**" | |
| - "apps/db-compare/**" | |
| - "apps/dump-db/**" | |
| - "apps/edit-docs/**" | |
| - "apps/build-docs/**" | |
| - "apps/icon-pack-builder/**" | |
| - "apps/client/src/translations/**" | |
| - "apps/server/src/assets/translations/**" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| actions: read | |
| contents: read | |
| jobs: | |
| e2e-server: | |
| 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@v7 | |
| with: | |
| filter: tree:0 | |
| fetch-depth: 0 | |
| # The build-server composite already sets up pnpm, Node (with the pnpm | |
| # cache) and installs dependencies. Running setup-node a second time at the | |
| # job level registered a duplicate pnpm cache post-step that failed the job | |
| # during cleanup ("Path Validation Error ... do not exist"), so we rely on | |
| # the composite alone for environment setup. | |
| - name: Build the server | |
| uses: ./.github/actions/build-server | |
| with: | |
| os: linux | |
| arch: ${{ matrix.arch }} | |
| - name: Install Playwright browsers | |
| run: pnpm exec playwright install --with-deps | |
| - name: Copy test fixture database | |
| run: cp packages/trilium-core/src/test/fixtures/document.db apps/server/spec/db/document.db | |
| - 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 | |
| - name: Upload test report | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: e2e report ${{ matrix.arch }} | |
| path: apps/server/test-output | |
| - name: Kill the server | |
| if: always() | |
| run: pkill -f trilium || true | |
| e2e-pdfjs-viewer: | |
| runs-on: ubuntu-22.04 | |
| name: PDF viewer E2E tests | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Install Playwright browsers | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: PDF viewer end-to-end tests | |
| run: pnpm --filter pdfjs-viewer e2e | |
| - name: Upload test report | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: pdfjs-viewer e2e report | |
| path: packages/pdfjs-viewer/test-output | |
| e2e-standalone: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: linux-x64 | |
| os: ubuntu-22.04 | |
| - name: linux-arm64 | |
| os: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.os }} | |
| name: Standalone E2E tests on ${{ matrix.name }} | |
| env: | |
| TRILIUM_DOCKER: 1 | |
| TRILIUM_PORT: 8082 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| filter: tree:0 | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Install Playwright browsers | |
| run: pnpm exec playwright install --with-deps | |
| - name: Build standalone | |
| run: TRILIUM_INTEGRATION_TEST=memory pnpm --filter standalone build | |
| - name: Start standalone preview server | |
| run: | | |
| cd apps/standalone | |
| pnpm vite preview --port $TRILIUM_PORT --host 127.0.0.1 & | |
| sleep 5 | |
| - name: Standalone end-to-end tests | |
| run: pnpm --filter standalone e2e | |
| - name: Upload test report | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: standalone e2e report ${{ matrix.name }} | |
| path: apps/standalone/test-output |