-
Notifications
You must be signed in to change notification settings - Fork 263
216 lines (198 loc) · 7.52 KB
/
test-rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: Test Rust
on:
push:
branches:
- v1
- v2
paths:
- ".github/workflows/test-rust.yml"
- "plugins/*/src/**"
- "!plugins/*/src/api-iife.js"
- "**/Cargo.toml"
- "**/Cargo.lock"
pull_request:
branches:
- v1
- v2
paths:
- ".github/workflows/test-rust.yml"
- "plugins/*/src/**"
- "!plugins/*/src/api-iife.js"
- "**/Cargo.toml"
- "**/Cargo.lock"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
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:
base: v2
filters: |
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-manager:
- .github/workflows/test-rust.yml
- plugins/clipboard-manager/**
tauri-plugin-deep-link:
- .github/workflows/test-rust.yml
- plugins/deep-link/**
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-state:
- .github/workflows/test-rust.yml
- plugins/window-state/**
test:
needs: changes
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }}
strategy:
fail-fast: false
matrix:
package: ${{ fromJSON(needs.changes.outputs.packages) }}
platform:
- {
target: x86_64-pc-windows-msvc,
os: windows-latest,
runner: "cargo",
command: "test",
}
- {
target: x86_64-unknown-linux-gnu,
os: ubuntu-latest,
runner: "cargo",
command: "test",
}
- {
target: x86_64-apple-darwin,
os: macos-latest,
runner: "cargo",
command: "test",
}
- {
target: aarch64-apple-ios,
os: macos-latest,
runner: "cargo",
command: "build",
}
- {
target: aarch64-linux-android,
os: ubuntu-latest,
runner: "cross",
command: "build",
}
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v3
- name: install webkit2gtk and libudev for [authenticator]
if: contains(matrix.platform.target, 'unknown-linux')
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libudev-dev
- name: install openssl
if: ${{ matrix.platform.os == 'windows-latest' && matrix.package == 'tauri-plugin-authenticator' }}
run: |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
vcpkg install openssl:x64-windows-static-md
- uses: dtolnay/rust-toolchain@1.75.0
with:
targets: ${{ matrix.platform.target }}
- uses: Swatinem/rust-cache@v2
with:
key: cache-${{ matrix.package }}-${{ matrix.platform.target }}
- name: create dummy dist
working-directory: examples/api
run: mkdir dist
- name: install cross
if: ${{ matrix.platform.runner == 'cross' }}
run: cargo +stable install cross --git https://github.com/cross-rs/cross
- name: test ${{ matrix.package }}
if: matrix.package != 'tauri-plugin-sql' && matrix.package != 'tauri-plugin-http'
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --all-features
- name: test ${{ matrix.package }}
if: matrix.package == 'tauri-plugin-http'
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets
- name: test ${{ matrix.package }} sqlite
if: matrix.package == 'tauri-plugin-sql'
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features sqlite
- name: test ${{ matrix.package }} mysql
if: matrix.package == 'tauri-plugin-sql'
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features mysql
- name: test ${{ matrix.package }} postgres
if: matrix.package == 'tauri-plugin-sql'
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features postgres