-
-
Notifications
You must be signed in to change notification settings - Fork 160
173 lines (155 loc) · 4.29 KB
/
opencv-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
name: opencv-rust
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
src:
strategy:
fail-fast: false
matrix:
os-image:
- ubuntu-22.04
- macos-13
opencv-version:
- 3.4.20
- 4.10.0
linkage:
- dynamic
include:
- os-image: ubuntu-22.04
opencv-version: 4.10.0
linkage: static
runs-on: ${{ matrix.os-image }}
env:
Atlas_ROOT_DIR: /usr/include/ # for cmake to find lapacke.h
OPENCV_VERSION: ${{ matrix.opencv-version }}
OPENCV_LINKAGE: ${{ matrix.linkage }}
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CMAKE_C_COMPILER_LAUNCHER: "sccache"
CMAKE_CXX_COMPILER_LAUNCHER: "sccache"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/[email protected]
- uses: actions/cache@v4
with:
path: ~/dist
key: dist-${{ matrix.opencv-version }}
- uses: actions/cache@v4
with:
path: ~/build
key: build-${{ matrix.opencv-version }}-${{ matrix.linkage }}-${{ matrix.os-image }}
- name: Install dependencies
run: ci/install.sh
shell: bash
- name: Test project
run: ci/script.sh
shell: bash
vcpkg:
strategy:
fail-fast: false
matrix:
os-image:
- ubuntu-22.04
- windows-2022
- macos-14
vcpkg-version:
- 2024.07.12
runs-on: ${{ matrix.os-image }}
env:
VCPKG_VERSION: ${{ matrix.vcpkg-version }}
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/[email protected]
- uses: actions/cache@v4
with:
path: ~/build
key: vcpkg-${{ matrix.vcpkg-version }}-${{ matrix.os-image }}
- name: Install dependencies
run: ci/install.sh
shell: bash
- name: Test project
run: ci/script.sh
shell: bash
bin:
strategy:
fail-fast: false
matrix:
os-image:
- windows-2022
version:
- opencv: 3.4.16
- opencv: 4.10.0
include:
- os-image: ubuntu-22.04
version:
opencv: 4.5.4
- os-image: ubuntu-20.04
version:
opencv: 4.2.0
- os-image: macos-14
version:
brew: "@4"
runs-on: ${{ matrix.os-image }}
env:
OPENCV_VERSION: ${{ matrix.version.opencv }}
BREW_OPENCV_VERSION: ${{ matrix.version.brew }}
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/[email protected]
- name: Install dependencies
run: ci/install.sh
shell: bash
- name: Test project
run: ci/script.sh
shell: bash
docs-rs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run a documentation generation test
run: ci/docs-rs.sh
shell: bash
msrv:
runs-on: ubuntu-20.04
env:
OPENCV_VERSION: 4.10.0
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CMAKE_C_COMPILER_LAUNCHER: "sccache"
CMAKE_CXX_COMPILER_LAUNCHER: "sccache"
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/[email protected]
- uses: actions/cache@v4
with:
path: ~/dist
key: dist-${{ env.OPENCV_VERSION }}
- uses: actions/cache@v4
with:
path: ~/build
key: build-${{ env.OPENCV_VERSION }}-ubuntu-20.04
- name: Get MSRV package metadata
id: metadata
run: cargo metadata --no-deps --format-version 1 | jq -r '"msrv="+(.packages[]|select(.name=="opencv").rust_version)' >> $GITHUB_OUTPUT
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.metadata.outputs.msrv }}
- name: Install dependencies
run: ci/install.sh
shell: bash
- name: Check project
run: ci/msrv.sh
shell: bash