readest/.github/workflows/pull-request.yml
dependabot[bot] 6ea11a3cfd
chore(deps): Bump the github-actions group with 6 updates (#7964)
Bumps the github-actions group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [github/codeql-action/init](https://github.com/github/codeql-action) | `4.39.3` | `4.39.4` |
| [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.39.3` | `4.39.4` |
| [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.39.3` | `4.39.4` |
| [cachix/install-nix-action](https://github.com/cachix/install-nix-action) | `31.11.5` | `32.0.0` |
| [DeterminateSystems/determinate-nix-action](https://github.com/determinatesystems/determinate-nix-action) | `3.24.2` | `3.24.3` |
| [ossf/scorecard-action](https://github.com/ossf/scorecard-action) | `2.5.0` | `2.6.0` |


Updates `github/codeql-action/init` from 4.39.3 to 4.39.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](33d7b85da1...1bd86f2fdb)

Updates `github/codeql-action/analyze` from 4.39.3 to 4.39.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](33d7b85da1...1bd86f2fdb)

Updates `github/codeql-action/upload-sarif` from 4.39.3 to 4.39.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](33d7b85da1...1bd86f2fdb)

Updates `cachix/install-nix-action` from 31.11.5 to 32.0.0
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](3dc140bfc7...bb0495a108)

Updates `DeterminateSystems/determinate-nix-action` from 3.24.2 to 3.24.3
- [Release notes](https://github.com/determinatesystems/determinate-nix-action/releases)
- [Commits](16f94ba7aa...4b04042352)

Updates `ossf/scorecard-action` from 2.5.0 to 2.6.0
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](fa7117db83...23f22cd436)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.39.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.39.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.39.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: cachix/install-nix-action
  dependency-version: 32.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: DeterminateSystems/determinate-nix-action
  dependency-version: 3.24.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: ossf/scorecard-action
  dependency-version: 2.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-26 06:55:30 +01:00

517 lines
20 KiB
YAML

name: PR checks
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
# Outside PRs must link an issue and attribute every commit to an agent and
# model (CONTRIBUTING.md); every other job waits on this and is skipped when
# it fails. pr-gate.yml posts the explanation on the PR.
gate:
name: CI gate
runs-on: ubuntu-latest
permissions:
contents: read
issues: read
pull-requests: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: .github/scripts
persist-credentials: false
- run: node .github/scripts/pr-gate.mjs
env:
GITHUB_TOKEN: ${{ github.token }}
# Evaluation only: the flake exposes no `checks`, so this verifies that every
# output still evaluates across systems without compiling anything. The full
# build runs in nix-build.yml on main, which is also what populates the cache.
# Only on pull_request: main pushes are already covered by nix-build.yml, and
# running both there would build and push the same paths twice.
nix_flake_check:
needs: gate
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: cachix/install-nix-action@bb0495a1086c46893eee56f32fd192dfe4a15bb9
# skipPush is a cachix-action input, not an install-nix-action one. The
# cache is public, so pulling needs no token at all; omitting authToken
# keeps the push token out of PR-triggered builds entirely.
- uses: cachix/cachix-action@38b082610b782e7e93e209c35fd730d399dee866
with:
name: readest
skipPush: true
- name: check flake
run: nix flake check --all-systems -L
# The Rust format/clippy/test steps only run when src-tauri changed, so the
# ~45s toolchain + system-dep install (and the compile itself) is skipped on
# PRs that don't touch the Rust backend. The job still runs and reports
# success so it stays green as a required check.
rust_lint:
needs: gate
runs-on: ubuntu-latest
# pull-requests: read lets dorny/paths-filter list a PR's changed files
# via the REST API (the top-level grant is contents: read only).
permissions:
contents: read
pull-requests: read
env:
RUSTFLAGS: '-C target-cpu=skylake'
SCCACHE_GHA_ENABLED: 'true'
RUSTC_WRAPPER: sccache
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: 'true'
- name: detect src-tauri changes
id: changes
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4
with:
filters: |
tauri:
- 'apps/readest-app/src-tauri/**'
# Unconditional: the check must also run when its own source
# (scripts/check-eink-identity-sync.mjs) changes, which the tauri
# paths-filter above does not match.
- name: e-ink identity whitelist sync (Rust vs Kotlin)
run: node scripts/check-eink-identity-sync.mjs
- name: setup sccache
if: steps.changes.outputs.tauri == 'true'
uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11
- name: Install minimal stable with clippy and rustfmt
if: steps.changes.outputs.tauri == 'true'
uses: actions-rust-lang/setup-rust-toolchain@a188e68d0fd2bd36ad51dccb2b07ba6e75105f30 # v2.0.1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Cache apt packages
if: steps.changes.outputs.tauri == 'true'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /var/cache/apt/archives
key: apt-rust-lint-${{ runner.os }}
- name: Install system dependencies
if: steps.changes.outputs.tauri == 'true'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libasound2-dev libclang-dev g++ libfontconfig-dev libglib2.0-dev libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libsoup-3.0-dev
- name: Format check
if: steps.changes.outputs.tauri == 'true'
working-directory: apps/readest-app/src-tauri
run: cargo fmt --check
- name: Clippy Check
if: steps.changes.outputs.tauri == 'true'
working-directory: apps/readest-app/src-tauri
run: cargo clippy -p Readest --no-deps -- -D warnings
- name: Unit tests
if: steps.changes.outputs.tauri == 'true'
working-directory: apps/readest-app/src-tauri
run: |
cargo test -p Readest --lib
cargo test -p tauri-plugin-native-tts --lib
python3 -I plugins/tauri-plugin-native-tts/tests/linux_lifecycle.py
# apps/readest.koplugin/native/localsend-bin is a standalone Cargo crate
# (not part of the src-tauri workspace), built into the koplugin's release
# libs by the release workflow. Before this job it had no PR-time CI at
# all. Paths-filtered like rust_lint so most PRs skip the toolchain install.
koplugin_rust_lint:
needs: gate
runs-on: ubuntu-latest
# pull-requests: read lets dorny/paths-filter list a PR's changed files
# via the REST API (the top-level grant is contents: read only).
permissions:
contents: read
pull-requests: read
env:
SCCACHE_GHA_ENABLED: 'true'
RUSTC_WRAPPER: sccache
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: 'true'
- name: detect localsend-bin changes
id: changes
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4
with:
filters: |
native:
- 'apps/readest.koplugin/native/**'
- name: setup sccache
if: steps.changes.outputs.native == 'true'
uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11
- name: Install minimal stable with clippy and rustfmt
if: steps.changes.outputs.native == 'true'
uses: actions-rust-lang/setup-rust-toolchain@a188e68d0fd2bd36ad51dccb2b07ba6e75105f30 # v2.0.1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Format check
if: steps.changes.outputs.native == 'true'
working-directory: apps/readest.koplugin/native/localsend-bin
run: cargo fmt --check
- name: Clippy Check
if: steps.changes.outputs.native == 'true'
working-directory: apps/readest.koplugin/native/localsend-bin
run: cargo clippy --all-targets -- -D warnings
- name: Unit tests
if: steps.changes.outputs.native == 'true'
working-directory: apps/readest.koplugin/native/localsend-bin
run: cargo test
build_web_app:
needs: gate
# Pinned: our Playwright (1.60) has no Chromium build for ubuntu26.04,
# which ubuntu-latest now resolves to on some runners.
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: 'true'
- name: setup pnpm
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- name: setup node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version: 24
cache: pnpm
- name: install Dependencies
working-directory: apps/readest-app
run: |
pnpm install --frozen-lockfile --prefer-offline && pnpm setup-vendors
- name: run format check
run: |
pnpm format:check || (pnpm format && git diff && exit 1)
# pnpm lint here is web-only (tsc + biome). The koplugin syntax check
# (lint:lua) runs in the test_extensions job, which installs LuaJIT only
# when the koplugin sources changed.
- name: run lint
working-directory: apps/readest-app
run: |
pnpm lint
- name: build the web app
working-directory: apps/readest-app
run: |
pnpm build-web && pnpm check:all
- name: cache playwright browsers
id: playwright-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: install playwright browsers
working-directory: apps/readest-app
run: |
if [ "${{ steps.playwright-cache.outputs.cache-hit }}" = 'true' ]; then
npx playwright install-deps chromium
else
npx playwright install --with-deps chromium
fi
- name: run web e2e tests
id: web_e2e
working-directory: apps/readest-app
run: pnpm test:e2e:web
- name: upload e2e report
if: ${{ failure() && steps.web_e2e.outcome == 'failure' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: playwright-report
path: apps/readest-app/playwright-report/
retention-days: 7
# The jsdom unit suite is the slowest part of the PR checks, so it is split
# across two parallel shards (vitest --shard). The browser tests run in
# test_web_browser; koplugin + browser-extension tests in test_extensions.
test_web_app:
needs: gate
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
shard: [1, 2]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: 'true'
- name: setup pnpm
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- name: setup node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version: 24
cache: pnpm
- name: install Dependencies
working-directory: apps/readest-app
run: |
pnpm install --frozen-lockfile --prefer-offline && pnpm setup-vendors
- name: run web unit tests (shard ${{ matrix.shard }}/2)
working-directory: apps/readest-app
run: pnpm test:pr:web:unit --shard=${{ matrix.shard }}/2
test_web_browser:
needs: gate
# Pinned: our Playwright (1.60) has no Chromium build for ubuntu26.04,
# which ubuntu-latest now resolves to on some runners.
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: 'true'
- name: setup pnpm
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- name: setup node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version: 24
cache: pnpm
- name: install Dependencies
working-directory: apps/readest-app
run: |
pnpm install --frozen-lockfile --prefer-offline && pnpm setup-vendors
- name: cache playwright browsers
id: playwright-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: playwright-chromium-webkit-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: install playwright browsers
working-directory: apps/readest-app
run: |
if [ "${{ steps.playwright-cache.outputs.cache-hit }}" = 'true' ]; then
npx playwright install-deps chromium webkit
else
npx playwright install --with-deps chromium webkit
fi
- name: run web browser tests
working-directory: apps/readest-app
run: pnpm test:browser
# The tests listed in vitest.browser.webkit.config.mts, in WebKit: the
# engine of the macOS and iOS apps, which paginates differently
- name: run WebKit browser tests
working-directory: apps/readest-app
run: pnpm test:browser:webkit
# Browser-extension tests + build always run. The koplugin lint + Lua tests
# (and the ~45s LuaJIT/busted install they need) only run when the koplugin
# sources changed, so most PRs skip that cost entirely.
test_extensions:
needs: gate
runs-on: ubuntu-latest
# pull-requests: read lets dorny/paths-filter list a PR's changed files
# via the REST API (the top-level grant is contents: read only).
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: 'true'
- name: detect koplugin changes
id: changes
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4
with:
filters: |
koplugin:
- 'apps/readest.koplugin/**'
- name: setup pnpm
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- name: setup node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version: 24
cache: pnpm
- name: install Dependencies
working-directory: apps/readest-app
run: |
pnpm install --frozen-lockfile --prefer-offline && pnpm setup-vendors
- name: run extension tests
working-directory: apps/readest-app
run: pnpm test:extension
- name: build browser extension
working-directory: apps/readest-app
run: pnpm build-browser-ext
- name: cache apt packages
if: steps.changes.outputs.koplugin == 'true'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /var/cache/apt/archives
key: apt-test-koplugin-${{ runner.os }}
- name: install LuaJIT + busted (for koplugin lint + tests)
if: steps.changes.outputs.koplugin == 'true'
run: |
sudo apt-get update
# luajit — pnpm lint:lua + pnpm test:lua
# luarocks/libsqlite3-dev — required to build lsqlite3complete
sudo apt-get install -y luajit luarocks libsqlite3-dev
# Install busted + the SQLite binding the LibraryStore specs use,
# both pinned to Lua 5.1 (LuaJIT-compatible). System-wide install
# so `luarocks --lua-version=5.1 path` (sourced by
# scripts/test-koplugin.mjs) picks them up.
sudo luarocks --lua-version=5.1 install busted
sudo luarocks --lua-version=5.1 install lsqlite3complete
- name: lint koplugin
if: steps.changes.outputs.koplugin == 'true'
working-directory: apps/readest-app
run: pnpm lint:lua
- name: run koplugin tests
if: steps.changes.outputs.koplugin == 'true'
working-directory: apps/readest-app
run: pnpm test:lua
# The desktop app build + webdriver tests need a full Rust compile, by far
# the slowest PR check, so every step after checkout is skipped when neither
# the Rust backend, the vendored native packages, nor the tauri test harness
# changed. Frontend-only PRs are covered by the web build/test jobs. The job
# still runs and reports success so it stays green as a required check.
build_tauri_app:
needs: gate
runs-on: ubuntu-latest
# pull-requests: read lets dorny/paths-filter list a PR's changed files
# via the REST API (the top-level grant is contents: read only).
permissions:
contents: read
pull-requests: read
env:
SCCACHE_GHA_ENABLED: 'true'
RUSTC_WRAPPER: sccache
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: 'true'
- name: detect tauri-related changes
id: changes
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4
with:
filters: |
tauri:
- 'apps/readest-app/src-tauri/**'
- 'apps/readest-app/src/**/*.tauri.test.ts'
- 'apps/readest-app/vitest.tauri.config.mts'
- 'apps/readest-app/vitest.tauri.setup.ts'
- 'apps/readest-app/scripts/test-tauri.sh'
- 'packages/**'
- 'pnpm-lock.yaml'
- '.github/workflows/pull-request.yml'
- name: setup pnpm
if: steps.changes.outputs.tauri == 'true'
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- name: setup node
if: steps.changes.outputs.tauri == 'true'
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version: 24
cache: pnpm
# The tauri tests run `next dev`, whose Turbopack cache lives in
# `.next/dev/cache` (a different path from the `next build` cache).
- name: cache Turbopack dev cache
if: steps.changes.outputs.tauri == 'true'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: apps/readest-app/.next/dev/cache
key: turbo-dev-tauri-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
turbo-dev-tauri-${{ runner.os }}-
- name: install Dependencies
if: steps.changes.outputs.tauri == 'true'
working-directory: apps/readest-app
run: |
pnpm install --frozen-lockfile --prefer-offline && pnpm setup-vendors
- name: setup sccache
if: steps.changes.outputs.tauri == 'true'
uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11
- name: install Rust toolchain
if: steps.changes.outputs.tauri == 'true'
uses: actions-rust-lang/setup-rust-toolchain@a188e68d0fd2bd36ad51dccb2b07ba6e75105f30 # v2.0.1
with:
toolchain: stable
# This action defaults RUSTFLAGS to -D warnings. Path-patched
# dependencies (packages/tauri, packages/swift-rs) build without
# cap-lints, so upstream warnings in them would fail the app
# build. Warnings in our own crate are enforced by the rust_lint
# job instead.
rustflags: ''
# Disable this action's built-in rust-cache so the explicit
# Swatinem/rust-cache below is the single cache (it's the one
# configured with cache-workspace-crates for the vendored tauri fork).
cache: false
- uses: Swatinem/rust-cache@eedcf2fb1c22f010a0eb66b92f378c110977f266 # v2
if: steps.changes.outputs.tauri == 'true'
with:
# cache-workspace-crates caches the path/workspace crates too: the
# vendored tauri fork (packages/tauri, wired via [patch.crates-io])
# and the local src-tauri/plugins/*. These are
# workspace members that rust-cache prunes by default, so the whole
# tauri stack — plus every crates.io plugin that depends on the
# patched `tauri` — rebuilt on every run. They change only
# sporadically (pinned submodules), so caching them is a big win.
# The key is bumped (-ws) so the old workspace-crate-less cache is
# invalidated and the next run repopulates it with the workspace
# crates included.
key: tauri-cargo-ws
cache-all-crates: 'true'
cache-workspace-crates: 'true'
- name: Cache apt packages
if: steps.changes.outputs.tauri == 'true'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /var/cache/apt/archives
key: apt-tauri-${{ runner.os }}
- name: install system dependencies
if: steps.changes.outputs.tauri == 'true'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libasound2-dev libclang-dev g++ libfontconfig-dev libglib2.0-dev libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev libsoup-3.0-dev xvfb
- name: run tauri tests
if: steps.changes.outputs.tauri == 'true'
working-directory: apps/readest-app
run: xvfb-run pnpm test:pr:tauri