mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-30 17:48:50 +02:00
ci: smarter tests (#370)
This commit is contained in:
@@ -23,10 +23,108 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
changes:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
outputs:
|
||||||
|
packages: ${{ steps.filter.outputs.changes }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dorny/paths-filter@v2
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
tauri-plugin-app:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/app/**
|
||||||
|
tauri-plugin-authenticator:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/authenticator/**
|
||||||
|
tauri-plugin-autostart:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/autostart/**
|
||||||
|
tauri-plugin-cli:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/cli/**
|
||||||
|
tauri-plugin-clipboard:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/clipboard/**
|
||||||
|
tauri-plugin-dialog:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/dialog/**
|
||||||
|
- plugins/fs/**
|
||||||
|
tauri-plugin-fs:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/fs/**
|
||||||
|
tauri-plugin-global-shortcut:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/global-shortcut/**
|
||||||
|
tauri-plugin-http:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/http/**
|
||||||
|
- plugins/fs/**
|
||||||
|
tauri-plugin-localhost:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/localhost/**
|
||||||
|
tauri-plugin-log:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/log/**
|
||||||
|
tauri-plugin-notification:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/notification/**
|
||||||
|
tauri-plugin-os:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/os/**
|
||||||
|
tauri-plugin-persisted-scope:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/persisted-scope/**
|
||||||
|
- plugins/fs/**
|
||||||
|
tauri-plugin-positioner:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/positioner/**
|
||||||
|
tauri-plugin-process:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/process/**
|
||||||
|
tauri-plugin-shell:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/shell/**
|
||||||
|
tauri-plugin-single-instance:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/single-instance/**
|
||||||
|
tauri-plugin-sql:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/sql/**
|
||||||
|
tauri-plugin-store:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/store/**
|
||||||
|
tauri-plugin-stronghold:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/stronghold/**
|
||||||
|
tauri-plugin-updater:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/updater/**
|
||||||
|
tauri-plugin-upload:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/upload/**
|
||||||
|
tauri-plugin-websocket:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/websocket/**
|
||||||
|
tauri-plugin-window:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/window/**
|
||||||
|
tauri-plugin-window-state:
|
||||||
|
- .github/workflows/lint-rust.yml
|
||||||
|
- plugins/window-state/**
|
||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
package: ${{ fromJSON(needs.changes.outputs.packages) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -47,17 +145,21 @@ jobs:
|
|||||||
working-directory: examples/api
|
working-directory: examples/api
|
||||||
run: mkdir dist
|
run: mkdir dist
|
||||||
|
|
||||||
- name: clippy
|
- name: clippy ${{ matrix.package }}
|
||||||
run: cargo clippy --workspace --exclude 'tauri-plugin-sql' --all-targets --all-features -- -D warnings
|
if: matrix.package != 'tauri-plugin-sql'
|
||||||
|
run: cargo clippy --package ${{ matrix.package }} --all-targets -- -D warnings
|
||||||
|
|
||||||
- name: clippy sql:sqlite
|
- name: clippy ${{ matrix.package }} --all-features
|
||||||
run: cargo clippy --package 'tauri-plugin-sql' --all-targets --features sqlite -- -D warnings
|
if: ${{ !contains(fromJSON('["tauri-plugin-http", "tauri-plugin-upload", "tauri-plugin-updater", "tauri-plugin-websocket", "tauri-plugin-sql"]'), matrix.package) }}
|
||||||
|
run: cargo clippy --package ${{ matrix.package }} --all-targets --all-features -- -D warnings
|
||||||
|
|
||||||
- name: clippy sql:mysql
|
- name: clippy ${{ matrix.package }} mysql
|
||||||
run: cargo clippy --package 'tauri-plugin-sql' --all-targets --features mysql -- -D warnings
|
if: matrix.package == 'tauri-plugin-sql'
|
||||||
|
run: cargo clippy --package ${{ matrix.package }} --all-targets --no-default-features --features mysql -- -D warnings
|
||||||
|
|
||||||
- name: clippy sql:postgres
|
- name: clippy ${{ matrix.package }} postgres
|
||||||
run: cargo clippy --package 'tauri-plugin-sql' --all-targets --features postgres -- -D warnings
|
if: matrix.package == 'tauri-plugin-sql'
|
||||||
|
run: cargo clippy --package ${{ matrix.package }} --all-targets --no-default-features --features postgres -- -D warnings
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
+112
-11
@@ -25,14 +25,111 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
changes:
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
outputs:
|
||||||
|
packages: ${{ steps.filter.outputs.changes }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dorny/paths-filter@v2
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
tauri-plugin-app:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/app/**
|
||||||
|
tauri-plugin-authenticator:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/authenticator/**
|
||||||
|
tauri-plugin-autostart:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/autostart/**
|
||||||
|
tauri-plugin-cli:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/cli/**
|
||||||
|
tauri-plugin-clipboard:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/clipboard/**
|
||||||
|
tauri-plugin-dialog:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/dialog/**
|
||||||
|
- plugins/fs/**
|
||||||
|
tauri-plugin-fs:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/fs/**
|
||||||
|
tauri-plugin-global-shortcut:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/global-shortcut/**
|
||||||
|
tauri-plugin-http:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/http/**
|
||||||
|
- plugins/fs/**
|
||||||
|
tauri-plugin-localhost:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/localhost/**
|
||||||
|
tauri-plugin-log:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/log/**
|
||||||
|
tauri-plugin-notification:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/notification/**
|
||||||
|
tauri-plugin-os:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/os/**
|
||||||
|
tauri-plugin-persisted-scope:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/persisted-scope/**
|
||||||
|
- plugins/fs/**
|
||||||
|
tauri-plugin-positioner:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/positioner/**
|
||||||
|
tauri-plugin-process:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/process/**
|
||||||
|
tauri-plugin-shell:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/shell/**
|
||||||
|
tauri-plugin-single-instance:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/single-instance/**
|
||||||
|
tauri-plugin-sql:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/sql/**
|
||||||
|
tauri-plugin-store:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/store/**
|
||||||
|
tauri-plugin-stronghold:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/stronghold/**
|
||||||
|
tauri-plugin-updater:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/updater/**
|
||||||
|
tauri-plugin-upload:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/upload/**
|
||||||
|
tauri-plugin-websocket:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/websocket/**
|
||||||
|
tauri-plugin-window:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/window/**
|
||||||
|
tauri-plugin-window-state:
|
||||||
|
- .github/workflows/test-rust.yml
|
||||||
|
- plugins/window-state/**
|
||||||
|
|
||||||
|
test:
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
package: ${{ fromJSON(needs.changes.outputs.packages) }}
|
||||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
@@ -43,7 +140,7 @@ jobs:
|
|||||||
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev
|
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev
|
||||||
|
|
||||||
- name: install openssl
|
- name: install openssl
|
||||||
if: matrix.platform == 'windows-latest'
|
if: ${{ matrix.platform == 'windows-latest' && matrix.package == 'tauri-plugin-authenticator' }}
|
||||||
run: |
|
run: |
|
||||||
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
|
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||||
vcpkg install openssl:x64-windows-static-md
|
vcpkg install openssl:x64-windows-static-md
|
||||||
@@ -56,14 +153,18 @@ jobs:
|
|||||||
working-directory: examples/api
|
working-directory: examples/api
|
||||||
run: mkdir dist
|
run: mkdir dist
|
||||||
|
|
||||||
- name: build
|
- name: test ${{ matrix.package }}
|
||||||
run: cargo build --workspace --exclude 'tauri-plugin-sql' --all-targets --all-features
|
if: matrix.package != 'tauri-plugin-sql'
|
||||||
|
run: cargo test --package ${{ matrix.package }} --all-targets
|
||||||
|
|
||||||
- name: build sql:sqlite
|
- name: test ${{ matrix.package }} --all-features
|
||||||
run: cargo build --package 'tauri-plugin-sql' --all-targets --features sqlite
|
if: ${{ !contains(fromJSON('["tauri-plugin-http", "tauri-plugin-upload", "tauri-plugin-updater", "tauri-plugin-websocket", "tauri-plugin-sql"]'), matrix.package) }}
|
||||||
|
run: cargo test --package ${{ matrix.package }} --all-targets --all-features
|
||||||
|
|
||||||
- name: build sql:mysql
|
- name: test ${{ matrix.package }} mysql
|
||||||
run: cargo build --package 'tauri-plugin-sql' --all-targets --features mysql
|
if: matrix.package == 'tauri-plugin-sql'
|
||||||
|
run: cargo test --package ${{ matrix.package }} --all-targets --no-default-features --features mysql
|
||||||
|
|
||||||
- name: build sql:postgres
|
- name: test ${{ matrix.package }} postgres
|
||||||
run: cargo build --package 'tauri-plugin-sql' --all-targets --features postgres
|
if: matrix.package == 'tauri-plugin-sql'
|
||||||
|
run: cargo test --package ${{ matrix.package }} --all-targets --no-default-features --features postgres
|
||||||
|
|||||||
Generated
+6
@@ -5756,9 +5756,13 @@ dependencies = [
|
|||||||
"futures-util",
|
"futures-util",
|
||||||
"log",
|
"log",
|
||||||
"native-tls",
|
"native-tls",
|
||||||
|
"rustls",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-native-tls",
|
"tokio-native-tls",
|
||||||
|
"tokio-rustls",
|
||||||
"tungstenite",
|
"tungstenite",
|
||||||
|
"webpki",
|
||||||
|
"webpki-roots",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -5915,10 +5919,12 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
"native-tls",
|
"native-tls",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
|
"rustls",
|
||||||
"sha1",
|
"sha1",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"url",
|
"url",
|
||||||
"utf-8",
|
"utf-8",
|
||||||
|
"webpki",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ http = "0.2"
|
|||||||
reqwest = { version = "0.11", default-features = false, features = [ "json", "stream" ] }
|
reqwest = { version = "0.11", default-features = false, features = [ "json", "stream" ] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
default = [ "native-tls-vendored" ]
|
||||||
multipart = [ "reqwest/multipart" ]
|
multipart = [ "reqwest/multipart" ]
|
||||||
native-tls = [ "reqwest/native-tls" ]
|
native-tls = [ "reqwest/native-tls" ]
|
||||||
native-tls-vendored = [ "reqwest/native-tls-vendored" ]
|
native-tls-vendored = [ "reqwest/native-tls-vendored" ]
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ time = "0.3"
|
|||||||
tokio = { version = "1", features = ["sync"] }
|
tokio = { version = "1", features = ["sync"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
default = [ "sqlite" ]
|
||||||
sqlite = ["sqlx/sqlite"]
|
sqlite = ["sqlx/sqlite"]
|
||||||
mysql = ["sqlx/mysql"]
|
mysql = ["sqlx/mysql"]
|
||||||
postgres = ["sqlx/postgres"]
|
postgres = ["sqlx/postgres"]
|
||||||
@@ -35,6 +35,7 @@ mockito = "0.31"
|
|||||||
tokio-test = "0.4.2"
|
tokio-test = "0.4.2"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
default = [ "native-tls-vendored" ]
|
||||||
native-tls = [ "reqwest/native-tls" ]
|
native-tls = [ "reqwest/native-tls" ]
|
||||||
native-tls-vendored = [ "reqwest/native-tls-vendored" ]
|
native-tls-vendored = [ "reqwest/native-tls-vendored" ]
|
||||||
rustls-tls = [ "reqwest/rustls-tls" ]
|
rustls-tls = [ "reqwest/rustls-tls" ]
|
||||||
|
|||||||
@@ -19,4 +19,10 @@ tokio = { version = "1", features = [ "fs" ] }
|
|||||||
tokio-util = { version = "0.7", features = [ "codec" ] }
|
tokio-util = { version = "0.7", features = [ "codec" ] }
|
||||||
reqwest = { version = "0.11", features = [ "json", "stream" ] }
|
reqwest = { version = "0.11", features = [ "json", "stream" ] }
|
||||||
futures-util = "0.3"
|
futures-util = "0.3"
|
||||||
read-progress-stream = "1.0.0"
|
read-progress-stream = "1.0.0"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = [ "native-tls-vendored" ]
|
||||||
|
native-tls = [ "reqwest/native-tls" ]
|
||||||
|
native-tls-vendored = [ "reqwest/native-tls-vendored" ]
|
||||||
|
rustls-tls = [ "reqwest/rustls-tls" ]
|
||||||
@@ -19,3 +19,9 @@ rand = "0.8"
|
|||||||
futures-util = "0.3"
|
futures-util = "0.3"
|
||||||
tokio = { version = "1", features = ["net", "sync"] }
|
tokio = { version = "1", features = ["net", "sync"] }
|
||||||
tokio-tungstenite = { version = "0.18", features = ["native-tls"] }
|
tokio-tungstenite = { version = "0.18", features = ["native-tls"] }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = [ "native-tls-vendored" ]
|
||||||
|
native-tls = [ "tokio-tungstenite/native-tls" ]
|
||||||
|
native-tls-vendored = [ "tokio-tungstenite/native-tls-vendored" ]
|
||||||
|
rustls-tls-webpki-roots = [ "tokio-tungstenite/rustls-tls-webpki-roots" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user