forked from l1npengtul/nokhwa
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.57 KB
/
examples.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
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
#
# While our "example" application has the platform-specific code,
# for simplicity we are compiling and testing everything on the Ubuntu environment only.
# For multi-OS testing see the `cross.yml` workflow.
on:
push: {}
name: Compile and check all examples
# We specify the examples individually since they might need a different environment
jobs:
compile_examples:
strategy:
fail-fast: false
matrix:
example: ["capture", "convert-to-rgb", "threaded-capture"]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: jwlawson/actions-setup-cmake@v2
- uses: ilammy/setup-nasm@v1
- name: Checkout sources
uses: actions/checkout@v2
- name: Install alsa-tools (ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y alsa-tools libasound2-dev libudev-dev
- name: "Activate MSYS2 on Windows"
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
clang
nasm
- name: Build example
working-directory: examples/${{ matrix.example }}
run: cargo build
- name: Clippy example
working-directory: examples/${{ matrix.example }}
run: cargo clippy