From b64599aab4d020beddda0b66e2c4e6d30724707f Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 7 Jul 2023 15:33:01 +0700 Subject: [PATCH 1/6] ci: Update to actions/checkout@v3. --- .github/workflows/bloat.yml | 6 +++--- .github/workflows/ci.yml | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/bloat.yml b/.github/workflows/bloat.yml index acd74ed8..50a3b3b7 100644 --- a/.github/workflows/bloat.yml +++ b/.github/workflows/bloat.yml @@ -11,7 +11,7 @@ jobs: if: (!startsWith(github.event_name, 'issue_comment') || startsWith(github.event.comment.body, '/bloat')) steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: get revisions id: get_revs @@ -25,7 +25,7 @@ jobs: if: steps.get_revs.outputs.fetch != '' - name: checkout base - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ steps.get_revs.outputs.base }} @@ -54,7 +54,7 @@ jobs: target/release/examples/quit.rs target/release/examples/shello.rs - name: checkout head - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: clean: false # avoid rebuilding artifacts unnecessarily ref: ${{ steps.get_revs.outputs.head }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee313d9a..625a1f73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest name: cargo fmt steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install stable toolchain uses: actions-rs/toolchain@v1 @@ -32,7 +32,7 @@ jobs: os: [macOS-latest, windows-2019, ubuntu-latest] name: cargo clippy+test steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install libx11-dev run: | @@ -70,7 +70,7 @@ jobs: runs-on: ubuntu-latest name: cargo clippy+test (wayland) steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install wayland run: | @@ -104,7 +104,7 @@ jobs: # runs-on: macOS-latest # name: cargo test (wasm32) # steps: -# - uses: actions/checkout@v2 +# - uses: actions/checkout@v3 # # - name: install wasm-pack # uses: jetli/wasm-pack-action@v0.3.0 @@ -141,7 +141,7 @@ jobs: runs-on: macOS-latest name: glazier doctests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install stable toolchain uses: actions-rs/toolchain@v1 @@ -168,7 +168,7 @@ jobs: runs-on: macOS-latest name: cargo clippy+test beta steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install beta toolchain uses: actions-rs/toolchain@v1 @@ -201,7 +201,7 @@ jobs: runs-on: macOS-latest name: glazier doctests beta steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install beta toolchain uses: actions-rs/toolchain@v1 @@ -226,7 +226,7 @@ jobs: matrix: os: [macOS-latest, windows-2019] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install dependencies run: | From 6b9c04216811ad31ec68bdac43e2e4be477c3573 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 7 Jul 2023 15:50:01 +0700 Subject: [PATCH 2/6] ci: actions-rs/toolchain to dtolnay/rust-toolchain `actions-rs` actions have been unmaintained for years and produce warnings when used as they trigger deprecation notices about functionality that GitHub will be removing. --- .github/workflows/bloat.yml | 5 ++-- .github/workflows/ci.yml | 48 +++++++++++++------------------------ 2 files changed, 18 insertions(+), 35 deletions(-) diff --git a/.github/workflows/bloat.yml b/.github/workflows/bloat.yml index 50a3b3b7..b1898ce4 100644 --- a/.github/workflows/bloat.yml +++ b/.github/workflows/bloat.yml @@ -30,10 +30,9 @@ jobs: ref: ${{ steps.get_revs.outputs.base }} - name: setup stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: stable - override: true + toolchain: "stable" - name: build base if: steps.get_revs.outputs.base != steps.get_revs.outputs.head diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 625a1f73..cf41e060 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,12 +12,10 @@ jobs: - uses: actions/checkout@v3 - name: install stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: 1.68 - profile: minimal + toolchain: "1.68" components: rustfmt - override: true - name: cargo fmt uses: actions-rs/cargo@v1 @@ -41,12 +39,10 @@ jobs: if: contains(matrix.os, 'ubuntu') - name: install stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: 1.68 + toolchain: "1.68" components: clippy - profile: minimal - override: true - name: restore cache uses: Swatinem/rust-cache@v1 @@ -78,12 +74,10 @@ jobs: sudo apt install libwayland-dev libpango1.0-dev libxkbcommon-dev - name: install stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: 1.68 + toolchain: "1.68" components: clippy - profile: minimal - override: true - name: restore cache uses: Swatinem/rust-cache@v1 @@ -112,13 +106,11 @@ jobs: # version: latest # # - name: install stable toolchain -# uses: actions-rs/toolchain@v1 +# uses: dtolnay/rust-toolchain@master # with: -# toolchain: 1.68 +# toolchain: "1.68" # target: wasm32-unknown-unknown # components: clippy -# profile: minimal -# override: true # # - name: restore cache # uses: Swatinem/rust-cache@v1 @@ -144,11 +136,9 @@ jobs: - uses: actions/checkout@v3 - name: install stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: 1.68 - profile: minimal - override: true + toolchain: "1.68" - name: restore cache uses: Swatinem/rust-cache@v1 @@ -171,12 +161,10 @@ jobs: - uses: actions/checkout@v3 - name: install beta toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: beta + toolchain: "beta" components: clippy - profile: minimal - override: true - name: restore cache uses: Swatinem/rust-cache@v1 @@ -204,11 +192,9 @@ jobs: - uses: actions/checkout@v3 - name: install beta toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: beta - profile: minimal - override: true + toolchain: "beta" - name: restore cache uses: Swatinem/rust-cache@v1 @@ -235,11 +221,9 @@ jobs: if: contains(matrix.os, 'ubuntu') - name: install stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - toolchain: 1.68 - profile: minimal - override: true + toolchain: "1.68" - name: restore cache uses: Swatinem/rust-cache@v1 From fb04bd9bcc53c0b5631fa0c117942b1dc097315f Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 7 Jul 2023 16:47:27 +0700 Subject: [PATCH 3/6] ci: Run cargo directly, no actions-rs/cargo. `actions-rs` actions have been unmaintained for years and produce warnings when used as they trigger deprecation notices about functionality that GitHub will be removing. --- .github/workflows/bloat.yml | 10 ++---- .github/workflows/ci.yml | 65 ++++++++----------------------------- 2 files changed, 15 insertions(+), 60 deletions(-) diff --git a/.github/workflows/bloat.yml b/.github/workflows/bloat.yml index b1898ce4..0cdc9bb6 100644 --- a/.github/workflows/bloat.yml +++ b/.github/workflows/bloat.yml @@ -36,10 +36,7 @@ jobs: - name: build base if: steps.get_revs.outputs.base != steps.get_revs.outputs.head - uses: actions-rs/cargo@v1 - with: - command: build - args: --release --examples + run: cargo build --release --examples - name: get old sizes if: steps.get_revs.outputs.base != steps.get_revs.outputs.head @@ -60,10 +57,7 @@ jobs: - name: build head if: steps.get_revs.outputs.base != steps.get_revs.outputs.head - uses: actions-rs/cargo@v1 - with: - command: build - args: --release --examples + run: cargo build --release --examples - name: get new sizes if: steps.get_revs.outputs.base != steps.get_revs.outputs.head diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf41e060..70017bdf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,10 +18,7 @@ jobs: components: 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 }} @@ -49,17 +46,11 @@ jobs: # Clippy packages in deeper-to-higher dependency order - name: cargo clippy glazier - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=Cargo.toml --all-targets --features=x11 --no-default-features -- -D warnings + run: cargo clippy --manifest-path=Cargo.toml --all-targets --features=x11 --no-default-features -- -D warnings # Test packages in deeper-to-higher dependency order - name: cargo test glazier - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=Cargo.toml --no-default-features --features=x11 + run: cargo test --manifest-path=Cargo.toml --no-default-features --features=x11 # we test the wayland backend as a separate job test-stable-wayland: @@ -83,16 +74,10 @@ jobs: uses: Swatinem/rust-cache@v1 - name: cargo clippy glazier - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=Cargo.toml --all-targets --features=wayland --no-default-features -- -D warnings + run: cargo clippy --manifest-path=Cargo.toml --all-targets --features=wayland --no-default-features -- -D warnings - name: cargo test glazier - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=Cargo.toml --features wayland --no-default-features + run: cargo test --manifest-path=Cargo.toml --features wayland --no-default-features # test-stable-wasm: # runs-on: macOS-latest @@ -116,18 +101,12 @@ jobs: # uses: Swatinem/rust-cache@v1 # # - name: cargo clippy glazier (wasm) -# uses: actions-rs/cargo@v1 -# with: -# command: clippy -# args: --manifest-path=Cargo.toml --all-targets --target wasm32-unknown-unknown -- -D warnings +# run: cargo clippy --manifest-path=Cargo.toml --all-targets --target wasm32-unknown-unknown -- -D warnings # # # Test wasm32 relevant 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 compile glazier -# uses: actions-rs/cargo@v1 -# with: -# command: test -# args: --manifest-path=Cargo.toml --no-run --target wasm32-unknown-unknown +# run: cargo test --manifest-path=Cargo.toml --no-run --target wasm32-unknown-unknown doctest-stable: runs-on: macOS-latest @@ -144,10 +123,7 @@ jobs: uses: Swatinem/rust-cache@v1 - name: cargo test glazier --doc - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=Cargo.toml --doc --no-default-features --features=image,im + run: cargo test --manifest-path=Cargo.toml --doc --no-default-features --features=image,im # This tests the future rust compiler to catch errors ahead of time without # breaking CI @@ -171,18 +147,12 @@ jobs: # Clippy packages in deeper-to-higher dependency order - name: cargo clippy glazier - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --manifest-path=Cargo.toml --all-targets -- -D warnings + run: cargo clippy --manifest-path=Cargo.toml --all-targets -- -D warnings continue-on-error: true # Test packages in deeper-to-higher dependency order - name: cargo test glazier - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=Cargo.toml --no-default-features --features=x11 + run: cargo test --manifest-path=Cargo.toml --no-default-features --features=x11 continue-on-error: true doctest-beta: @@ -200,10 +170,7 @@ jobs: uses: Swatinem/rust-cache@v1 - name: cargo test glazier --doc - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=Cargo.toml --doc --features=image,im + run: cargo test --manifest-path=Cargo.toml --doc --features=image,im check-docs: name: Docs @@ -230,15 +197,9 @@ jobs: # Doc packages in deeper-to-higher dependency order - name: cargo doc glazier - uses: actions-rs/cargo@v1 - with: - command: doc - args: --manifest-path=Cargo.toml --no-deps --document-private-items + run: cargo doc --manifest-path=Cargo.toml --no-deps --document-private-items # On Linux also attempt docs for X11. - name: cargo doc glazier (X11) - uses: actions-rs/cargo@v1 - with: - command: doc - args: --manifest-path=Cargo.toml --features=x11 --no-deps --document-private-items + run: cargo doc --manifest-path=Cargo.toml --features=x11 --no-deps --document-private-items if: contains(matrix.os, 'ubuntu') From cb76dd08e3cc78166e3477e9e6cafd28874a8018 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 7 Jul 2023 18:28:08 +0700 Subject: [PATCH 4/6] ci: Stop passing `--manifest-path` to cargo. This was a remnant of the `druid-shell` days and not needed here. --- .github/workflows/ci.yml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70017bdf..f8b8df93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,13 +44,11 @@ jobs: - name: restore cache uses: Swatinem/rust-cache@v1 - # Clippy packages in deeper-to-higher dependency order - name: cargo clippy glazier - run: cargo clippy --manifest-path=Cargo.toml --all-targets --features=x11 --no-default-features -- -D warnings + run: cargo clippy --all-targets --features=x11 --no-default-features -- -D warnings - # Test packages in deeper-to-higher dependency order - name: cargo test glazier - run: cargo test --manifest-path=Cargo.toml --no-default-features --features=x11 + run: cargo test --no-default-features --features=x11 # we test the wayland backend as a separate job test-stable-wayland: @@ -74,10 +72,10 @@ jobs: uses: Swatinem/rust-cache@v1 - name: cargo clippy glazier - run: cargo clippy --manifest-path=Cargo.toml --all-targets --features=wayland --no-default-features -- -D warnings + run: cargo clippy --all-targets --features=wayland --no-default-features -- -D warnings - name: cargo test glazier - run: cargo test --manifest-path=Cargo.toml --features wayland --no-default-features + run: cargo test --features wayland --no-default-features # test-stable-wasm: # runs-on: macOS-latest @@ -101,12 +99,11 @@ jobs: # uses: Swatinem/rust-cache@v1 # # - name: cargo clippy glazier (wasm) -# run: cargo clippy --manifest-path=Cargo.toml --all-targets --target wasm32-unknown-unknown -- -D warnings +# run: cargo clippy --all-targets --target wasm32-unknown-unknown -- -D warnings # -# # Test wasm32 relevant 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 compile glazier -# run: cargo test --manifest-path=Cargo.toml --no-run --target wasm32-unknown-unknown +# run: cargo test --no-run --target wasm32-unknown-unknown doctest-stable: runs-on: macOS-latest @@ -123,7 +120,7 @@ jobs: uses: Swatinem/rust-cache@v1 - name: cargo test glazier --doc - run: cargo test --manifest-path=Cargo.toml --doc --no-default-features --features=image,im + run: cargo test --doc --no-default-features --features=image,im # This tests the future rust compiler to catch errors ahead of time without # breaking CI @@ -145,14 +142,12 @@ jobs: - name: restore cache uses: Swatinem/rust-cache@v1 - # Clippy packages in deeper-to-higher dependency order - name: cargo clippy glazier - run: cargo clippy --manifest-path=Cargo.toml --all-targets -- -D warnings + run: cargo clippy --all-targets -- -D warnings continue-on-error: true - # Test packages in deeper-to-higher dependency order - name: cargo test glazier - run: cargo test --manifest-path=Cargo.toml --no-default-features --features=x11 + run: cargo test --no-default-features --features=x11 continue-on-error: true doctest-beta: @@ -170,7 +165,7 @@ jobs: uses: Swatinem/rust-cache@v1 - name: cargo test glazier --doc - run: cargo test --manifest-path=Cargo.toml --doc --features=image,im + run: cargo test --doc --features=image,im check-docs: name: Docs @@ -195,11 +190,10 @@ jobs: - name: restore cache uses: Swatinem/rust-cache@v1 - # Doc packages in deeper-to-higher dependency order - name: cargo doc glazier - run: cargo doc --manifest-path=Cargo.toml --no-deps --document-private-items + run: cargo doc --no-deps --document-private-items # On Linux also attempt docs for X11. - name: cargo doc glazier (X11) - run: cargo doc --manifest-path=Cargo.toml --features=x11 --no-deps --document-private-items + run: cargo doc --features=x11 --no-deps --document-private-items if: contains(matrix.os, 'ubuntu') From 9f89412b7124a63128083c4d04e1b1ec28cf2200 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 7 Jul 2023 16:57:23 +0700 Subject: [PATCH 5/6] ci: Update to Swatinem/rust-cache@v2 from v1. v1 produces warnings when used as it triggers deprecation notices about functionality that GitHub will be removing. --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8b8df93..68a17981 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: components: clippy - name: restore cache - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2 - name: cargo clippy glazier run: cargo clippy --all-targets --features=x11 --no-default-features -- -D warnings @@ -69,7 +69,7 @@ jobs: components: clippy - name: restore cache - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2 - name: cargo clippy glazier run: cargo clippy --all-targets --features=wayland --no-default-features -- -D warnings @@ -96,7 +96,7 @@ jobs: # components: clippy # # - name: restore cache -# uses: Swatinem/rust-cache@v1 +# uses: Swatinem/rust-cache@v2 # # - name: cargo clippy glazier (wasm) # run: cargo clippy --all-targets --target wasm32-unknown-unknown -- -D warnings @@ -117,7 +117,7 @@ jobs: toolchain: "1.68" - name: restore cache - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2 - name: cargo test glazier --doc run: cargo test --doc --no-default-features --features=image,im @@ -140,7 +140,7 @@ jobs: components: clippy - name: restore cache - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2 - name: cargo clippy glazier run: cargo clippy --all-targets -- -D warnings @@ -162,7 +162,7 @@ jobs: toolchain: "beta" - name: restore cache - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2 - name: cargo test glazier --doc run: cargo test --doc --features=image,im @@ -188,7 +188,7 @@ jobs: toolchain: "1.68" - name: restore cache - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2 - name: cargo doc glazier run: cargo doc --no-deps --document-private-items From 78911a9641b31c9a642baabf97735113a009bef6 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 7 Jul 2023 17:32:11 +0700 Subject: [PATCH 6/6] ci: Build lib + example with accesskit feature. This checks that the accesskit feature compiles the library and the `accesskit` example. This only runs the tries to build it on macOS and Windows as `glazier` doesn't yet support `accesskit` elsewhere. --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68a17981..eb472a50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,10 @@ jobs: - name: cargo test glazier run: cargo test --no-default-features --features=x11 + - name: cargo build accesskit example + run: cargo build --features accesskit --example accesskit + if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows') + # we test the wayland backend as a separate job test-stable-wayland: runs-on: ubuntu-latest