@@ -25,14 +25,111 @@ concurrency:
2525 cancel-in-progress : true
2626
2727jobs :
28- test :
29- runs-on : ${{ matrix.platform }}
28+ changes :
29+ runs-on : ubuntu-latest
30+ permissions :
31+ pull-requests : read
32+ outputs :
33+ packages : ${{ steps.filter.outputs.changes }}
34+ steps :
35+ - uses : actions/checkout@v3
36+ - uses : dorny/paths-filter@v2
37+ id : filter
38+ with :
39+ filters : |
40+ tauri-plugin-app:
41+ - .github/workflows/test-rust.yml
42+ - plugins/app/**
43+ tauri-plugin-authenticator:
44+ - .github/workflows/test-rust.yml
45+ - plugins/authenticator/**
46+ tauri-plugin-autostart:
47+ - .github/workflows/test-rust.yml
48+ - plugins/autostart/**
49+ tauri-plugin-cli:
50+ - .github/workflows/test-rust.yml
51+ - plugins/cli/**
52+ tauri-plugin-clipboard:
53+ - .github/workflows/test-rust.yml
54+ - plugins/clipboard/**
55+ tauri-plugin-dialog:
56+ - .github/workflows/test-rust.yml
57+ - plugins/dialog/**
58+ - plugins/fs/**
59+ tauri-plugin-fs:
60+ - .github/workflows/test-rust.yml
61+ - plugins/fs/**
62+ tauri-plugin-global-shortcut:
63+ - .github/workflows/test-rust.yml
64+ - plugins/global-shortcut/**
65+ tauri-plugin-http:
66+ - .github/workflows/test-rust.yml
67+ - plugins/http/**
68+ - plugins/fs/**
69+ tauri-plugin-localhost:
70+ - .github/workflows/test-rust.yml
71+ - plugins/localhost/**
72+ tauri-plugin-log:
73+ - .github/workflows/test-rust.yml
74+ - plugins/log/**
75+ tauri-plugin-notification:
76+ - .github/workflows/test-rust.yml
77+ - plugins/notification/**
78+ tauri-plugin-os:
79+ - .github/workflows/test-rust.yml
80+ - plugins/os/**
81+ tauri-plugin-persisted-scope:
82+ - .github/workflows/test-rust.yml
83+ - plugins/persisted-scope/**
84+ - plugins/fs/**
85+ tauri-plugin-positioner:
86+ - .github/workflows/test-rust.yml
87+ - plugins/positioner/**
88+ tauri-plugin-process:
89+ - .github/workflows/test-rust.yml
90+ - plugins/process/**
91+ tauri-plugin-shell:
92+ - .github/workflows/test-rust.yml
93+ - plugins/shell/**
94+ tauri-plugin-single-instance:
95+ - .github/workflows/test-rust.yml
96+ - plugins/single-instance/**
97+ tauri-plugin-sql:
98+ - .github/workflows/test-rust.yml
99+ - plugins/sql/**
100+ tauri-plugin-store:
101+ - .github/workflows/test-rust.yml
102+ - plugins/store/**
103+ tauri-plugin-stronghold:
104+ - .github/workflows/test-rust.yml
105+ - plugins/stronghold/**
106+ tauri-plugin-updater:
107+ - .github/workflows/test-rust.yml
108+ - plugins/updater/**
109+ tauri-plugin-upload:
110+ - .github/workflows/test-rust.yml
111+ - plugins/upload/**
112+ tauri-plugin-websocket:
113+ - .github/workflows/test-rust.yml
114+ - plugins/websocket/**
115+ tauri-plugin-window:
116+ - .github/workflows/test-rust.yml
117+ - plugins/window/**
118+ tauri-plugin-window-state:
119+ - .github/workflows/test-rust.yml
120+ - plugins/window-state/**
30121
122+ test :
123+ needs : changes
124+ if : ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }}
31125 strategy :
32126 fail-fast : false
33127 matrix :
128+ package : ${{ fromJSON(needs.changes.outputs.packages) }}
34129 platform : [ubuntu-latest, macos-latest, windows-latest]
35130
131+ runs-on : ${{ matrix.platform }}
132+
36133 steps :
37134 - uses : actions/checkout@v3
38135
43140 sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev
44141
45142 - name : install openssl
46- if : matrix.platform == 'windows-latest'
143+ if : ${{ matrix.platform == 'windows-latest' && matrix.package == 'tauri-plugin-authenticator' }}
47144 run : |
48145 echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
49146 vcpkg install openssl:x64-windows-static-md
@@ -56,14 +153,18 @@ jobs:
56153 working-directory : examples/api
57154 run : mkdir dist
58155
59- - name : build
60- run : cargo build --workspace --exclude 'tauri-plugin-sql' --all-targets --all-features
156+ - name : test ${{ matrix.package }}
157+ if : matrix.package != 'tauri-plugin-sql'
158+ run : cargo test --package ${{ matrix.package }} --all-targets
61159
62- - name : build sql:sqlite
63- run : cargo build --package 'tauri-plugin-sql' --all-targets --features sqlite
160+ - name : test ${{ matrix.package }} --all-features
161+ if : ${{ !contains(fromJSON('["tauri-plugin-http", "tauri-plugin-upload", "tauri-plugin-updater", "tauri-plugin-websocket", "tauri-plugin-sql"]'), matrix.package) }}
162+ run : cargo test --package ${{ matrix.package }} --all-targets --all-features
64163
65- - name : build sql:mysql
66- run : cargo build --package 'tauri-plugin-sql' --all-targets --features mysql
164+ - name : test ${{ matrix.package }} mysql
165+ if : matrix.package == 'tauri-plugin-sql'
166+ run : cargo test --package ${{ matrix.package }} --all-targets --no-default-features --features mysql
67167
68- - name : build sql:postgres
69- run : cargo build --package 'tauri-plugin-sql' --all-targets --features postgres
168+ - name : test ${{ matrix.package }} postgres
169+ if : matrix.package == 'tauri-plugin-sql'
170+ run : cargo test --package ${{ matrix.package }} --all-targets --no-default-features --features postgres
0 commit comments