ci: update actions (#58)

* update actions

* renames

* fix test

* matrix os -> platform
This commit is contained in:
Amr Bashir
2023-10-24 04:21:50 +03:00
committed by GitHub
parent 7bebf6d11c
commit e754acb2a5
10 changed files with 93 additions and 78 deletions

48
.github/workflows/clippy-fmt.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
# Copyright 2022-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: clippy & fmt
on:
push:
branches:
- dev
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
clippy:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: install system deps
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy --all-targets --all-features -- -D warnings
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check

View File

@@ -6,9 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/checkout@v4
- name: covector status
uses: jbolda/covector/packages/action@covector-v0
id: covector

View File

@@ -1,4 +1,4 @@
name: version or publish
name: covector version or publish
on:
push:
@@ -15,16 +15,16 @@ jobs:
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: rustup update
- uses: actions/checkout@v4
- name: cargo login
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
- name: git config
run: |
git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}"
- name: covector version or publish (publish when no change files present)
uses: jbolda/covector/packages/action@covector-v0
id: covector
@@ -34,14 +34,15 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
command: "version-or-publish"
createRelease: true
- name: Create Pull Request With Versions Bumped
id: cpr
uses: tauri-apps/create-pull-request@v3
if: steps.covector.outputs.commandRan == 'version'
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Publish New Versions"
commit-message: "publish new versions"
labels: "version updates"
branch: "release"
title: Apply Version Updates From Current Changes
commit-message: 'apply version updates'
labels: 'version updates'
branch: 'release'
body: ${{ steps.covector.outputs.change }}

View File

@@ -1,29 +0,0 @@
name: Format
on:
push:
branches:
- dev
pull_request:
branches:
- dev
jobs:
format:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Install rustfmt with nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path=Cargo.toml --all -- --check

View File

@@ -1,32 +1,27 @@
name: Test
name: test
on:
push:
branches:
- dev
pull_request:
branches:
- dev
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
test:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: install system deps
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path ./Cargo.toml --release
- uses: dtolnay/rust-toolchain@stable
- run: cargo test

View File

@@ -20,7 +20,7 @@ raw-window-handle = "0.5"
[dev-dependencies]
tao = "0.23"
winit = {version = "0.29", default-features = false, features = ["rwh_05"] }
winit = {version = "0.29", default-features = false, features = ["x11", "wayland", "wayland-dlopen", "wayland-csd-adwaita", "rwh_05"] }
[target."cfg(target_os = \"windows\")".dependencies]
windows-sys = { version = "0.48.0", features = [

View File

@@ -24,12 +24,12 @@ fn main() {
event_loop.run(move |event, _, control_flow| {
*control_flow = ControlFlow::Wait;
match event {
Event::WindowEvent {
event: WindowEvent::CloseRequested,
..
} => *control_flow = ControlFlow::Exit,
_ => (),
if let Event::WindowEvent {
event: WindowEvent::CloseRequested,
..
} = event
{
*control_flow = ControlFlow::Exit
}
});
}

View File

@@ -7,13 +7,13 @@ edition = "2021"
license = "MIT OR Apache-2.0"
[dependencies]
serde_json = "1.0"
serde_json = "1"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.3", features = ["api-all"] }
tauri = { version = "1", features = ["api-all"] }
window-shadows = { path = "../../../" }
[build-dependencies]
tauri-build = { version = "1.0.3" }
tauri-build = { version = "1" }
[features]
default = ["custom-protocol"]

View File

@@ -21,15 +21,17 @@ fn main() {
window.set_title("A fantastic window!");
event_loop.run(move |event, event_loop| {
event_loop.set_control_flow(ControlFlow::Wait);
event_loop
.run(move |event, event_loop| {
event_loop.set_control_flow(ControlFlow::Wait);
match event {
Event::WindowEvent {
if let Event::WindowEvent {
event: WindowEvent::CloseRequested,
..
} => event_loop.exit(),
_ => (),
}
});
} = event
{
event_loop.exit()
}
})
.unwrap();
}

View File

@@ -29,7 +29,7 @@
/// - **Linux**: Unsupported, Shadows are controlled by the compositor installed on the end-user system.
pub fn set_shadow(
window: impl raw_window_handle::HasRawWindowHandle,
enable: bool,
#[allow(unused)] enable: bool,
) -> Result<(), Error> {
match window.raw_window_handle() {
#[cfg(target_os = "macos")]