-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (161 loc) · 6.61 KB
/
test.yaml
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
# SPDX-FileCopyrightText: Copyright (C) 2018-2025 Uwe Klotz <uwedotklotzatgmaildotcom> et al.
# SPDX-License-Identifier: CC0-1.0
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
# Same as file name
name: test
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
- dev
workflow_dispatch:
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: short
jobs:
run:
strategy:
matrix:
include:
- target: aarch64-apple-darwin
runner_os: macos-14
default_target: true
runnable: true
- target: x86_64-apple-darwin
runner_os: macos-latest
default_target: true
runnable: true
- target: x86_64-pc-windows-msvc
runner_os: windows-latest
default_target: true
runnable: true
- target: x86_64-unknown-linux-gnu
runner_os: ubuntu-latest
default_target: true
runnable: true
- target: x86_64-unknown-linux-musl
runner_os: ubuntu-latest
default_target: false
runnable: true
runs-on: ${{ matrix.runner_os }}
steps:
- name: Install dependencies for musl libc
if: matrix.target == 'x86_64-unknown-linux-musl'
run: >-
sudo apt update &&
sudo apt -y install
musl-tools
# See also: <https://github.com/emilk/egui/blob/master/.github/workflows/rust.yml>
- name: Install dependencies for `egui` on Linux
if: runner.os == 'Linux'
run: >-
sudo apt update &&
sudo apt -y install
libgtk-3-dev
libssl-dev
libxcb-render0-dev
libxcb-shape0-dev
libxcb-xfixes0-dev
libxkbcommon-dev
- name: Install Rust toolchains for both native target and WASM
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}, wasm32-unknown-unknown
# Checkout the repository before the remaining steps that depend on it.
# All preceding steps are independent of the repository contents.
- name: Check out repository
uses: actions/checkout@v4
- name: Cache Rust toolchain and build artifacts
uses: Swatinem/rust-cache@v2
with:
# The cache should not be shared between different workflows and jobs.
# Two jobs might share the same default target but have different build targets.
shared-key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.target }}
- name: Check aoide-core
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/core/Cargo.toml
- name: Check aoide-core-json
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/core-json/Cargo.toml
- name: Check aoide-core-api
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/core-api/Cargo.toml
- name: Check aoide-core-api-json
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/core-api-json/Cargo.toml
- name: Check aoide-desktop-app
# TODO: Re-enable after cross-compilation issues for wayland-sys have been fixed.
if: false
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/desktop-app/Cargo.toml
- name: Check aoide-media
run: >-
cargo check --locked --target ${{ matrix.target }} --all-targets --all-features
--manifest-path crates/media-file/Cargo.toml
- name: Check aoide-repo
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/repo/Cargo.toml
- name: Check aoide-repo-sqlite
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/repo-sqlite/Cargo.toml
- name: Check aoide-storage-sqlite
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/storage-sqlite/Cargo.toml
- name: Check aoide-search-index-tantivy
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/search-index-tantivy/Cargo.toml
- name: Check aoide-usecases
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/usecases/Cargo.toml
- name: Check aoide-usecases-sqlite
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/usecases-sqlite/Cargo.toml
- name: Check aoide-backend-embedded
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/backend-embedded/Cargo.toml
- name: Check aoide-backend-webapi-json
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/backend-webapi-json/Cargo.toml
- name: Check aoide-websrv-warp-sqlite
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path crates/websrv-warp-sqlite/Cargo.toml
- name: Check aoide-websrv
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path websrv/Cargo.toml
- name: Check aoide-file-collection-app
run: >-
cargo check --locked --all-targets --all-features --target ${{ matrix.target }}
--manifest-path file-collection-app/Cargo.toml
- name: Build tests with all features enabled
run: >-
cargo test --locked --workspace --all-features --target ${{ matrix.target }}
--no-run
- name: Run tests with all features enabled
if: matrix.runnable
run: >-
cargo test --locked --workspace --all-features --target ${{ matrix.target }}
-- --nocapture --quiet
- name: Run doctests with all features enabled (only on default target)
if: matrix.default_target
run: >-
cargo test --locked --workspace --all-features
--doc