Skip to content

Commit

Permalink
LFG
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHayton committed Jul 30, 2024
1 parent 32e7f8e commit 9453cd2
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 23 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ on:
push: {}


name: Compile all examples
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:
Expand All @@ -26,9 +27,11 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Checkout sources
uses: actions/checkout@v2
- name: Cargo build all projects
run: bash ./scripts/build-all.sh
- name: Cargo clippy all projects
run: bash ./scripts/clippy-all.sh
- name: Build example
working-directory: examples/{{ matrix.example }}
run: cargo build
- name: Clippy example
working-directory: examples/{{ matrix.example }}
run: cargo clippy


33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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 main project

# We specify the examples individually since they might need a different environment
jobs:
compile_and_check:
strategy:
fail-fast: false
matrix:
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
- name: Checkout sources
uses: actions/checkout@v2
- name: Cargo build main project (Default features)
run: cargo build
- name: Cargo build main project (Optional features)
run: cargo build --features serialize,output-threaded
- name: Cargo clippy main project
run: cargo clippy
16 changes: 16 additions & 0 deletions scripts/build-all-examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Change directory to the example folder
cd examples

# Loop through each project in the example folder
for project in */; do
# Change directory to the project folder
cd "$project"

# Run cargo clippy
cargo build

# Change directory back to the example folder
cd ..
done
18 changes: 0 additions & 18 deletions scripts/build-all.sh

This file was deleted.

File renamed without changes.

0 comments on commit 9453cd2

Please sign in to comment.