mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-02 20:18:38 -05:00
Check VectorCraft selected-artboard retry and the production browser hook
This commit is contained in:
1 parent
3a9c4fc386
commit
9cd95522b3
2 files changed
+56
No files matched your search
@@ -0,0 +1,54 @@
|
||||
name: VectorCraft browser print handoff
|
||||
on:
|
||||
push:
|
||||
branches: [verify/vectorcraft-browser-handoff-4859]
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
browser:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 115
|
||||
env:
|
||||
CARGO_PROFILE_TEST_DEBUG: 0
|
||||
CARGO_PROFILE_DEV_DEBUG: 0
|
||||
CARGO_INCREMENTAL: 0
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: storytold/craft-common-actions/actions/checkout-craft-fonts@58848078cd09e3ca182891a8b76ee979f1eb6e1c
|
||||
with:
|
||||
ref: 16bbfc3d451fad51971ca3f2a28c1e69e279b67c
|
||||
- uses: storytold/craft-common-actions/actions/install-apt-packages@58848078cd09e3ca182891a8b76ee979f1eb6e1c
|
||||
with:
|
||||
packages: pkg-config libxkbcommon-dev libwayland-dev libx11-dev libxcb1-dev libxcursor-dev libxrandr-dev libxi-dev libfontconfig1-dev libfreetype-dev mesa-vulkan-drivers libgl1-mesa-dev libgtk-3-dev qpdf
|
||||
- name: Apply exact Safari and browser source to VectorCraft's baseline
|
||||
shell: python
|
||||
run: |
|
||||
import json, pathlib, subprocess
|
||||
graph = json.loads(subprocess.check_output(["cargo", "metadata", "--locked", "--format-version","1","--filter-platform","wasm32-unknown-unknown"]))
|
||||
package, = (p for p in graph["packages"] if p["name"] == "craft-print")
|
||||
crate = pathlib.Path(package["manifest_path"]).parent
|
||||
framework = pathlib.Path(subprocess.check_output(["git","rev-parse","--show-toplevel"], cwd=crate, text=True).strip())
|
||||
head = subprocess.check_output(["git","rev-parse","HEAD"], cwd=framework, text=True).strip()
|
||||
assert head == "77ade517ecb2a6ad86feb2f9983a098ad5738fc6", head
|
||||
revision = "d75e3d9636e6ec2c34f7253638aaeb21db9fe1bc"
|
||||
subprocess.run(["git","fetch","--depth=1","https://github.com/storytold/craft-libs.git",revision], cwd=framework, check=True)
|
||||
subprocess.run(["git","restore","--source",revision,"--worktree","--","crates/print/Cargo.toml","crates/print/src/browser.rs","crates/print/src/browser/safari.rs"], cwd=framework, check=True)
|
||||
- name: Check browser refusal and retrieve the actual selected artboards on retry
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p evidence
|
||||
export VECTOR_PRINT_OUTPUT="$PWD/evidence/retried-artboards.pdf"
|
||||
cargo test --locked -p vectorcraft-ui-egui --lib refused_browser_handoff_keeps_the_selected_artboards_for_retry
|
||||
qpdf --check "$VECTOR_PRINT_OUTPUT"
|
||||
test "$(qpdf --show-npages "$VECTOR_PRINT_OUTPUT")" = 2
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
|
||||
with:
|
||||
name: vectorcraft-retried-artboards
|
||||
path: evidence
|
||||
if-no-files-found: error
|
||||
- name: Check the real web app with the verified Safari and Chromium workflow
|
||||
run: |
|
||||
rustup target add wasm32-unknown-unknown
|
||||
cargo check --locked -p vectorcraft-web --target wasm32-unknown-unknown
|
||||
@@ -208,6 +208,8 @@ fn refused_browser_handoff_keeps_the_selected_artboards_for_retry() {
|
||||
assert_eq!(accepted.len(), 1);
|
||||
assert_eq!(accepted[0].0, None);
|
||||
assert_eq!(pages(&accepted[0].2), 2);
|
||||
let output = std::env::var("VECTOR_PRINT_OUTPUT").unwrap();
|
||||
std::fs::write(output, &accepted[0].2).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user