From 149ca2b5cbf4faac40cef2a6d23e73d0fe710e8a Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Sat, 24 Feb 2024 16:25:14 +0200 Subject: [PATCH 01/10] Update the CI and pin the Rust toolchain version. --- .github/workflows/ci.yml | 281 ++++++++++----------------------------- piet/snapshots | 2 +- 2 files changed, 73 insertions(+), 210 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03ea9194..c339c21d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,338 +1,201 @@ +env: + # We aim to always test with the latest stable Rust toolchain, however we pin to a specific + # version like 1.70. Note that we only specify MAJOR.MINOR and not PATCH so that bugfixes still + # come automatically. If the version specified here is no longer the latest stable version, + # then please feel free to submit a PR that adjusts it along with the potential clippy fixes. + RUST_STABLE_VER: "1.76" # In quotes because otherwise 1.70 would be interpreted as 1.7 + +name: CI + on: - push: - branches: - - master pull_request: + merge_group: jobs: rustfmt: runs-on: ubuntu-latest name: cargo fmt steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'true' - name: install stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: stable - profile: minimal + toolchain: ${{ env.RUST_STABLE_VER }} components: rustfmt - override: true - - - name: install rustfmt - run: rustup component add rustfmt - name: cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: cargo fmt --all --check test-stable: runs-on: ${{ matrix.os }} strategy: - fail-fast: false matrix: - os: [macOS-11, windows-2019, ubuntu-latest] - name: cargo clippy+test + os: [windows-latest, macos-latest, ubuntu-latest] + name: cargo clippy + test steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'true' - - name: install libgtk-dev + - name: install additional linux dependencies run: | sudo apt update sudo apt install libgtk-3-dev if: contains(matrix.os, 'ubuntu') - name: install stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: stable + toolchain: ${{ env.RUST_STABLE_VER }} components: clippy - profile: minimal - override: true + + - name: restore cache + uses: Swatinem/rust-cache@v2 # Clippy packages in deeper-to-higher dependency order - name: cargo clippy piet - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=piet/Cargo.toml --all-targets --all-features -- -D warnings + run: cargo clippy --manifest-path=piet/Cargo.toml --all-targets --all-features -- -D warnings - name: cargo clippy piet-cairo - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=piet-cairo/Cargo.toml --all-targets --all-features -- -D warnings + run: cargo clippy --manifest-path=piet-cairo/Cargo.toml --all-targets --all-features -- -D warnings if: contains(matrix.os, 'ubuntu') - name: cargo clippy piet-coregraphics - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=piet-coregraphics/Cargo.toml --all-targets --all-features -- -D warnings - if: contains(matrix.os, 'macOS') + run: cargo clippy --manifest-path=piet-coregraphics/Cargo.toml --all-targets --all-features -- -D warnings + if: contains(matrix.os, 'macos') - name: cargo clippy piet-direct2d - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=piet-direct2d/Cargo.toml --all-targets --all-features -- -D warnings + run: cargo clippy --manifest-path=piet-direct2d/Cargo.toml --all-targets --all-features -- -D warnings if: contains(matrix.os, 'windows') - name: cargo clippy piet-svg - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=piet-svg/Cargo.toml --all-targets --all-features -- -D warnings + run: cargo clippy --manifest-path=piet-svg/Cargo.toml --all-targets --all-features -- -D warnings - name: cargo clippy piet-common - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=piet-common/Cargo.toml --all-targets --features=png -- -D warnings + run: cargo clippy --manifest-path=piet-common/Cargo.toml --all-targets --features=png -- -D warnings # Test packages in deeper-to-higher dependency order - name: cargo test piet - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet/Cargo.toml --all-features + run: cargo test --manifest-path=piet/Cargo.toml --all-features - name: cargo test piet-cairo - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet-cairo/Cargo.toml --all-features + run: cargo test --manifest-path=piet-cairo/Cargo.toml --all-features if: contains(matrix.os, 'ubuntu') - name: cargo test piet-coregraphics - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet-coregraphics/Cargo.toml --all-features - if: contains(matrix.os, 'macOS') + run: cargo test --manifest-path=piet-coregraphics/Cargo.toml --all-features + if: contains(matrix.os, 'macos') - name: cargo test piet-direct2d - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet-direct2d/Cargo.toml --all-features + run: cargo test --manifest-path=piet-direct2d/Cargo.toml --all-features if: contains(matrix.os, 'windows') - name: cargo test piet-svg - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet-svg/Cargo.toml --all-features + run: cargo test --manifest-path=piet-svg/Cargo.toml --all-features - name: cargo test piet-common - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet-common/Cargo.toml --features=png + run: cargo test --manifest-path=piet-common/Cargo.toml --features=png test-stable-wasm: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macOS-11, windows-2019, ubuntu-latest] - name: cargo clippy+test (wasm32) + os: [windows-latest, macos-latest, ubuntu-latest] + name: cargo clippy + test (wasm32) steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'true' - name: install stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: stable - target: wasm32-unknown-unknown + toolchain: ${{ env.RUST_STABLE_VER }} + targets: wasm32-unknown-unknown components: clippy - profile: minimal - override: true + + - name: restore cache + uses: Swatinem/rust-cache@v2 # Clippy packages in deeper-to-higher dependency order - name: cargo clippy piet - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=piet/Cargo.toml --all-targets --all-features --target wasm32-unknown-unknown -- -D warnings + run: cargo clippy --manifest-path=piet/Cargo.toml --all-targets --all-features --target wasm32-unknown-unknown -- -D warnings - name: cargo clippy piet-web - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=piet-web/Cargo.toml --all-targets --all-features --target wasm32-unknown-unknown -- -D warnings + run: cargo clippy --manifest-path=piet-web/Cargo.toml --all-targets --all-features --target wasm32-unknown-unknown -- -D warnings - name: cargo clippy piet-common - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=piet-common/Cargo.toml --all-targets --features=png --target wasm32-unknown-unknown -- -D warnings + run: cargo clippy --manifest-path=piet-common/Cargo.toml --all-targets --features=png --target wasm32-unknown-unknown -- -D warnings # Test packages in deeper-to-higher dependency order # TODO: Find a way to make tests work. Until then the tests are merely compiled. - name: cargo test piet - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet/Cargo.toml --all-features --no-run --target wasm32-unknown-unknown + run: cargo test --manifest-path=piet/Cargo.toml --all-features --no-run --target wasm32-unknown-unknown - name: cargo test piet-web - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet-web/Cargo.toml --all-features --no-run --target wasm32-unknown-unknown + run: cargo test --manifest-path=piet-web/Cargo.toml --all-features --no-run --target wasm32-unknown-unknown - name: cargo test piet-common - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet-common/Cargo.toml --features=png --no-run --target wasm32-unknown-unknown + run: cargo test --manifest-path=piet-common/Cargo.toml --features=png --no-run --target wasm32-unknown-unknown - - name: Install wasm-pack + - name: install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: test chrome run: wasm-pack test --headless --chrome piet-common + - name: test firefox run: wasm-pack test --headless --firefox piet-common - test-nightly: + docs: + name: cargo doc runs-on: ${{ matrix.os }} strategy: matrix: - os: [macOS-11, windows-2019, ubuntu-latest] - name: cargo test nightly + os: [windows-latest, macos-latest, ubuntu-latest] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'true' - - name: install libgtk-dev + - name: install additional linux dependencies run: | sudo apt update sudo apt install libgtk-3-dev if: contains(matrix.os, 'ubuntu') - name: install nightly toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly - profile: minimal - override: true + targets: wasm32-unknown-unknown - # Test packages in deeper-to-higher dependency order - - name: cargo test piet - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet/Cargo.toml --all-features - - - name: cargo test piet-cairo - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet-cairo/Cargo.toml --all-features - if: contains(matrix.os, 'ubuntu') - - - name: cargo test piet-coregraphics - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet-coregraphics/Cargo.toml --all-features - if: contains(matrix.os, 'macOS') - - - name: cargo test piet-direct2d - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet-direct2d/Cargo.toml --all-features - if: contains(matrix.os, 'windows') - - - name: cargo test piet-svg - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet-svg/Cargo.toml --all-features - - - name: cargo test piet-common - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=piet-common/Cargo.toml --features=png - - check-docs: - name: Docs - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macOS-11, windows-2019, ubuntu-latest] - steps: - - uses: actions/checkout@v2 - with: - submodules: 'true' - - - name: install libgtk-dev - run: | - sudo apt update - sudo apt install libgtk-3-dev - if: contains(matrix.os, 'ubuntu') - - - name: install stable toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: wasm32-unknown-unknown - profile: minimal - override: true + - name: restore cache + uses: Swatinem/rust-cache@v2 # Doc packages in deeper-to-higher dependency order - name: cargo doc piet - uses: actions-rs/cargo@v1 - with: - command: doc - args: --manifest-path=piet/Cargo.toml --all-features --document-private-items + run: cargo doc --manifest-path=piet/Cargo.toml --all-features --document-private-items - name: cargo doc piet-cairo - uses: actions-rs/cargo@v1 - with: - command: doc - args: --manifest-path=piet-cairo/Cargo.toml --all-features --document-private-items + run: cargo doc --manifest-path=piet-cairo/Cargo.toml --all-features --document-private-items if: contains(matrix.os, 'ubuntu') - name: cargo doc piet-coregraphics - uses: actions-rs/cargo@v1 - with: - command: doc - args: --manifest-path=piet-coregraphics/Cargo.toml --all-features --document-private-items - if: contains(matrix.os, 'macOS') + run: cargo doc --manifest-path=piet-coregraphics/Cargo.toml --all-features --document-private-items + if: contains(matrix.os, 'macos') - name: cargo doc piet-direct2d - uses: actions-rs/cargo@v1 - with: - command: doc - args: --manifest-path=piet-direct2d/Cargo.toml --all-features --document-private-items + run: cargo doc --manifest-path=piet-direct2d/Cargo.toml --all-features --document-private-items if: contains(matrix.os, 'windows') - name: cargo doc piet-svg - uses: actions-rs/cargo@v1 - with: - command: doc - args: --manifest-path=piet-svg/Cargo.toml --all-features --document-private-items + run: cargo doc --manifest-path=piet-svg/Cargo.toml --all-features --document-private-items - name: cargo doc piet-common - uses: actions-rs/cargo@v1 - with: - command: doc - args: --manifest-path=piet-common/Cargo.toml --features=png --document-private-items + run: cargo doc --manifest-path=piet-common/Cargo.toml --features=png --document-private-items - name: cargo doc piet-web - uses: actions-rs/cargo@v1 - with: - command: doc - args: --manifest-path=piet-web/Cargo.toml --all-features --document-private-items --target wasm32-unknown-unknown + run: cargo doc --manifest-path=piet-web/Cargo.toml --all-features --document-private-items --target wasm32-unknown-unknown diff --git a/piet/snapshots b/piet/snapshots index 2d4fe483..9ce95bca 160000 --- a/piet/snapshots +++ b/piet/snapshots @@ -1 +1 @@ -Subproject commit 2d4fe483c7fde7639b9bb844a68382d9d870571a +Subproject commit 9ce95bca326db301b32d20cf5638f6ec90af5111 From a820106bffa0d45465338a648450425c48075f59 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Sat, 24 Feb 2024 16:30:05 +0200 Subject: [PATCH 02/10] Sync snapshots submodule. --- piet/snapshots | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piet/snapshots b/piet/snapshots index 9ce95bca..afac42fd 160000 --- a/piet/snapshots +++ b/piet/snapshots @@ -1 +1 @@ -Subproject commit 9ce95bca326db301b32d20cf5638f6ec90af5111 +Subproject commit afac42fd5a11b69e7573ecfe8fbc003934bff71d From 808c10da769275d5d7300129641bdb877b613f46 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Sat, 24 Feb 2024 16:47:23 +0200 Subject: [PATCH 03/10] Migrate snapshot testing to a unified CI script. --- .github/workflows/ci.yml | 73 +++++++++++++++++++++++++++ .github/workflows/snapshot.yml | 91 ---------------------------------- 2 files changed, 73 insertions(+), 91 deletions(-) delete mode 100644 .github/workflows/snapshot.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c339c21d..453c4bc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -199,3 +199,76 @@ jobs: - name: cargo doc piet-web run: cargo doc --manifest-path=piet-web/Cargo.toml --all-features --document-private-items --target wasm32-unknown-unknown + + compare-snapshots: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-latest, macos-latest, ubuntu-latest] + name: compare snapshots + steps: + - name: checkout + uses: actions/checkout@v4 + with: + submodules: 'true' + + - name: install additional linux dependencies + run: | + sudo apt update + sudo apt install libgtk-3-dev + if: contains(matrix.os, 'ubuntu') + + - name: install stable toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_STABLE_VER }} + components: clippy + + - name: restore cache + uses: Swatinem/rust-cache@v2 + + - name: generate and compare (1.00) (ubuntu+cairo) + run: cargo run --manifest-path=piet-cairo/Cargo.toml --example=test-picture -- --all --scale=1 --out=cairo_samples --compare=./piet/snapshots/cairo + if: contains(matrix.os, 'ubuntu') + + - name: generate and compare (2.00) (ubuntu+cairo) + run: cargo run --manifest-path=piet-cairo/Cargo.toml --example=test-picture -- --all --scale=2 --out=cairo_samples --compare=./piet/snapshots/cairo + if: contains(matrix.os, 'ubuntu') + + - name: upload failures (ubuntu+cairo) + uses: actions/upload-artifact@v4 + with: + name: cairo-failure + path: cairo_samples + if: contains(matrix.os, 'ubuntu') && failure() + + - name: generate and compare (1.00) (macos) + run: cargo run --manifest-path=piet-coregraphics/Cargo.toml --example=test-picture -- --all --scale=1 --out=coregraphics_samples --compare=./piet/snapshots/coregraphics + if: contains(matrix.os, 'macos') + + - name: generate and compare (2.00) (macos) + run: cargo run --manifest-path=piet-coregraphics/Cargo.toml --example=test-picture -- --all --scale=2 --out=coregraphics_samples --compare=./piet/snapshots/coregraphics + if: contains(matrix.os, 'macos') + + - name: upload failures (macos) + uses: actions/upload-artifact@v4 + with: + name: coregraphics-failure + path: coregraphics_samples + if: contains(matrix.os, 'macos') && failure() + + - name: generate and compare (1.00) (d2d) + run: cargo run --manifest-path=piet-direct2d/Cargo.toml --example=test-picture -- --all --scale=1 --out=d2d_samples --compare=./piet/snapshots/d2d + if: contains(matrix.os, 'windows') + + - name: generate and compare (2.00) (d2d) + run: cargo run --manifest-path=piet-direct2d/Cargo.toml --example=test-picture -- --all --scale=2 --out=d2d_samples --compare=./piet/snapshots/d2d + if: contains(matrix.os, 'windows') + + - name: upload failures (d2d) + uses: actions/upload-artifact@v4 + with: + name: d2d-failure + path: d2d_samples + if: contains(matrix.os, 'windows') && failure() diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml deleted file mode 100644 index 2dc4c825..00000000 --- a/.github/workflows/snapshot.yml +++ /dev/null @@ -1,91 +0,0 @@ -on: pull_request - -jobs: - compare-snapshots: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macOS-11, windows-2019, ubuntu-latest] - name: compare snapshots - steps: - - name: checkout - uses: actions/checkout@v2 - with: - submodules: 'true' - - - name: install libgtk-dev - run: | - sudo apt update - sudo apt install libgtk-3-dev - if: contains(matrix.os, 'ubuntu') - - - name: install stable toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: generate and compare (1.00) (ubuntu+cairo) - uses: actions-rs/cargo@v1 - with: - command: run - args: --manifest-path=piet-cairo/Cargo.toml --example=test-picture -- --all --scale=1 --out=cairo_samples --compare=./piet/snapshots/cairo - if: contains(matrix.os, 'ubuntu') - - - name: generate and compare (2.00) (ubuntu+cairo) - uses: actions-rs/cargo@v1 - with: - command: run - args: --manifest-path=piet-cairo/Cargo.toml --example=test-picture -- --all --scale=2 --out=cairo_samples --compare=./piet/snapshots/cairo - if: contains(matrix.os, 'ubuntu') - - - name: upload failures (ubuntu+cairo) - uses: actions/upload-artifact@v2 - with: - name: cairo-failure - path: cairo_samples - if: contains(matrix.os, 'ubuntu') && failure() - - - name: generate and compare (1.00) (macOS) - uses: actions-rs/cargo@v1 - with: - command: run - args: --manifest-path=piet-coregraphics/Cargo.toml --example=test-picture -- --all --scale=1 --out=coregraphics_samples --compare=./piet/snapshots/coregraphics - if: contains(matrix.os, 'macOS') - - - name: generate and compare (2.00) (macOS) - uses: actions-rs/cargo@v1 - with: - command: run - args: --manifest-path=piet-coregraphics/Cargo.toml --example=test-picture -- --all --scale=2 --out=coregraphics_samples --compare=./piet/snapshots/coregraphics - if: contains(matrix.os, 'macOS') - - - name: upload failures (macOS) - uses: actions/upload-artifact@v2 - with: - name: coregraphics-failure - path: coregraphics_samples - if: contains(matrix.os, 'macOS') && failure() - - - name: generate and compare (1.00) (d2d) - uses: actions-rs/cargo@v1 - with: - command: run - args: --manifest-path=piet-direct2d/Cargo.toml --example=test-picture -- --all --scale=1 --out=d2d_samples --compare=./piet/snapshots/d2d - if: contains(matrix.os, 'windows') - - - name: generate and compare (2.00) (d2d) - uses: actions-rs/cargo@v1 - with: - command: run - args: --manifest-path=piet-direct2d/Cargo.toml --example=test-picture -- --all --scale=2 --out=d2d_samples --compare=./piet/snapshots/d2d - if: contains(matrix.os, 'windows') - - - name: upload failures (d2d) - uses: actions/upload-artifact@v2 - with: - name: d2d-failure - path: d2d_samples - if: contains(matrix.os, 'windows') && failure() From 3d2e5649fe3277979289c17748f90dc4c056f473 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Sat, 24 Feb 2024 17:17:11 +0200 Subject: [PATCH 04/10] Continue snapshot gen on error. --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 453c4bc8..e663a326 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -229,10 +229,12 @@ jobs: uses: Swatinem/rust-cache@v2 - name: generate and compare (1.00) (ubuntu+cairo) + continue-on-error: true run: cargo run --manifest-path=piet-cairo/Cargo.toml --example=test-picture -- --all --scale=1 --out=cairo_samples --compare=./piet/snapshots/cairo if: contains(matrix.os, 'ubuntu') - name: generate and compare (2.00) (ubuntu+cairo) + continue-on-error: true run: cargo run --manifest-path=piet-cairo/Cargo.toml --example=test-picture -- --all --scale=2 --out=cairo_samples --compare=./piet/snapshots/cairo if: contains(matrix.os, 'ubuntu') @@ -244,10 +246,12 @@ jobs: if: contains(matrix.os, 'ubuntu') && failure() - name: generate and compare (1.00) (macos) + continue-on-error: true run: cargo run --manifest-path=piet-coregraphics/Cargo.toml --example=test-picture -- --all --scale=1 --out=coregraphics_samples --compare=./piet/snapshots/coregraphics if: contains(matrix.os, 'macos') - name: generate and compare (2.00) (macos) + continue-on-error: true run: cargo run --manifest-path=piet-coregraphics/Cargo.toml --example=test-picture -- --all --scale=2 --out=coregraphics_samples --compare=./piet/snapshots/coregraphics if: contains(matrix.os, 'macos') @@ -259,10 +263,12 @@ jobs: if: contains(matrix.os, 'macos') && failure() - name: generate and compare (1.00) (d2d) + continue-on-error: true run: cargo run --manifest-path=piet-direct2d/Cargo.toml --example=test-picture -- --all --scale=1 --out=d2d_samples --compare=./piet/snapshots/d2d if: contains(matrix.os, 'windows') - name: generate and compare (2.00) (d2d) + continue-on-error: true run: cargo run --manifest-path=piet-direct2d/Cargo.toml --example=test-picture -- --all --scale=2 --out=d2d_samples --compare=./piet/snapshots/d2d if: contains(matrix.os, 'windows') From ea1adf16ef155fc4d3ace405fc29624c188d47dc Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Sat, 24 Feb 2024 17:25:22 +0200 Subject: [PATCH 05/10] Add better implementation of continue-on-error. --- .github/workflows/ci.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e663a326..a279ff90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -228,15 +228,15 @@ jobs: - name: restore cache uses: Swatinem/rust-cache@v2 + # The user of always() allows for multiple scale factor steps to always run even if one of them fails. + - name: generate and compare (1.00) (ubuntu+cairo) - continue-on-error: true run: cargo run --manifest-path=piet-cairo/Cargo.toml --example=test-picture -- --all --scale=1 --out=cairo_samples --compare=./piet/snapshots/cairo - if: contains(matrix.os, 'ubuntu') + if: contains(matrix.os, 'ubuntu') && always() - name: generate and compare (2.00) (ubuntu+cairo) - continue-on-error: true run: cargo run --manifest-path=piet-cairo/Cargo.toml --example=test-picture -- --all --scale=2 --out=cairo_samples --compare=./piet/snapshots/cairo - if: contains(matrix.os, 'ubuntu') + if: contains(matrix.os, 'ubuntu') && always() - name: upload failures (ubuntu+cairo) uses: actions/upload-artifact@v4 @@ -246,14 +246,12 @@ jobs: if: contains(matrix.os, 'ubuntu') && failure() - name: generate and compare (1.00) (macos) - continue-on-error: true run: cargo run --manifest-path=piet-coregraphics/Cargo.toml --example=test-picture -- --all --scale=1 --out=coregraphics_samples --compare=./piet/snapshots/coregraphics - if: contains(matrix.os, 'macos') + if: contains(matrix.os, 'macos') && always() - name: generate and compare (2.00) (macos) - continue-on-error: true run: cargo run --manifest-path=piet-coregraphics/Cargo.toml --example=test-picture -- --all --scale=2 --out=coregraphics_samples --compare=./piet/snapshots/coregraphics - if: contains(matrix.os, 'macos') + if: contains(matrix.os, 'macos') && always() - name: upload failures (macos) uses: actions/upload-artifact@v4 @@ -263,14 +261,12 @@ jobs: if: contains(matrix.os, 'macos') && failure() - name: generate and compare (1.00) (d2d) - continue-on-error: true run: cargo run --manifest-path=piet-direct2d/Cargo.toml --example=test-picture -- --all --scale=1 --out=d2d_samples --compare=./piet/snapshots/d2d - if: contains(matrix.os, 'windows') + if: contains(matrix.os, 'windows') && always() - name: generate and compare (2.00) (d2d) - continue-on-error: true run: cargo run --manifest-path=piet-direct2d/Cargo.toml --example=test-picture -- --all --scale=2 --out=d2d_samples --compare=./piet/snapshots/d2d - if: contains(matrix.os, 'windows') + if: contains(matrix.os, 'windows') && always() - name: upload failures (d2d) uses: actions/upload-artifact@v4 From 13e0fa6a3a78252ef158c1a8688688ae8e0be222 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Sat, 24 Feb 2024 17:43:21 +0200 Subject: [PATCH 06/10] Update snapshots. --- piet/snapshots | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piet/snapshots b/piet/snapshots index afac42fd..25d94b65 160000 --- a/piet/snapshots +++ b/piet/snapshots @@ -1 +1 @@ -Subproject commit afac42fd5a11b69e7573ecfe8fbc003934bff71d +Subproject commit 25d94b65a7efc7f620148630b65705e0e3dd6070 From 807b4e804ea5778655d395af801e3db1b0bb3ad0 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Sat, 24 Feb 2024 17:50:11 +0200 Subject: [PATCH 07/10] Sync snapshots. --- piet/snapshots | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piet/snapshots b/piet/snapshots index 25d94b65..871c5492 160000 --- a/piet/snapshots +++ b/piet/snapshots @@ -1 +1 @@ -Subproject commit 25d94b65a7efc7f620148630b65705e0e3dd6070 +Subproject commit 871c5492abec0ce87560959e52a4c5c395325fed From 0aaca344baed71c425d190aa05d408e85aff05b3 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Sat, 24 Feb 2024 18:01:51 +0200 Subject: [PATCH 08/10] Pin nightly compiler to fix compilation. --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a279ff90..7f7fbf3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,7 +168,11 @@ jobs: if: contains(matrix.os, 'ubuntu') - name: install nightly toolchain - uses: dtolnay/rust-toolchain@nightly + # NOTE: Currently pinned to 2024-02-01. Move to just 'nightly' when possible. + # Right now that breaks the build due to pathfinder_simd 0.5.2 not compiling with nightly. + # The issue seems to have been fixed in https://github.com/servo/pathfinder/pull/548 + # However there is no new published crate version containing that fix, yet. + uses: dtolnay/rust-toolchain@nightly-2024-02-01 with: targets: wasm32-unknown-unknown From 6eeae729905886b77135a336761a94635d0a0aa6 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Sat, 24 Feb 2024 18:04:05 +0200 Subject: [PATCH 09/10] Fix CI nightly pin. --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f7fbf3c..fd09c1c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,12 +168,13 @@ jobs: if: contains(matrix.os, 'ubuntu') - name: install nightly toolchain - # NOTE: Currently pinned to 2024-02-01. Move to just 'nightly' when possible. + # NOTE: Currently pinned to 2024-02-01 with '@master'. Move to just '@nightly' when possible. # Right now that breaks the build due to pathfinder_simd 0.5.2 not compiling with nightly. # The issue seems to have been fixed in https://github.com/servo/pathfinder/pull/548 # However there is no new published crate version containing that fix, yet. - uses: dtolnay/rust-toolchain@nightly-2024-02-01 + uses: dtolnay/rust-toolchain@master with: + toolchain: nightly-2024-02-01 targets: wasm32-unknown-unknown - name: restore cache From a01f12c5ff74be2e0ab67658a2ce1060b7888ee2 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Sat, 24 Feb 2024 18:11:47 +0200 Subject: [PATCH 10/10] Add link to `piet-svg` issue. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd09c1c2..ec8ae5be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,6 +172,7 @@ jobs: # Right now that breaks the build due to pathfinder_simd 0.5.2 not compiling with nightly. # The issue seems to have been fixed in https://github.com/servo/pathfinder/pull/548 # However there is no new published crate version containing that fix, yet. + # See more at https://github.com/linebender/piet/issues/566 uses: dtolnay/rust-toolchain@master with: toolchain: nightly-2024-02-01