Skip to content

Commit

Permalink
Add check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmerlin committed Feb 15, 2023
1 parent 7725f3e commit 08745f7
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 7 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings

jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
features:
- winit
- gl
- winit,gl
- vulkan
include:
- os: macos-latest
features: "winit,gl,metal"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2

- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --features ${{ matrix.features }} -- -D warnings

- name: RustFmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --features ${{ matrix.features }} -- --check

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --features ${{ matrix.features }}

- name: Cargo Doc
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions-rs/cargo@v1
with:
command: doc
args: --lib --no-deps --features ${{ matrix.features }}

miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Miri
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: miri

# Separate miri setup from run so that 'Miri Test'
# logs are clean.
- name: Setup Miri
uses: actions-rs/cargo@v1
with:
command: miri
args: setup

- name: Miri Test
uses: actions-rs/cargo@v1
with:
command: miri
args: test --features winit
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ egui-winit = { version = ">=0.20", optional = true, default-features = false }
skulpin = { version = ">=0.14.1", features = [], optional = true}

[dev-dependencies]
softbuffer = { git = "https://github.com/john01dav/softbuffer" }
softbuffer = "0.2.0"
egui_demo_lib = ">=0.20"
raw-window-handle = "0.5"
foreign-types-shared = "0.1.1"
Expand Down
3 changes: 1 addition & 2 deletions examples/sdl2_opengl.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use egui_sdl2_event::DpiMode;

/// This is a mix of the rust-sdl2 opengl example,
/// the skia-safe gl window example: https://github.com/rust-skia/rust-skia/blob/master/skia-safe/examples/gl-window/main.rs
/// and the egui-sdl2-event example: https://github.com/kaphula/egui-sdl2-event-example
Expand All @@ -8,6 +6,7 @@ fn main() {
extern crate gl;
extern crate sdl2;

use egui_sdl2_event::DpiMode;
use egui_sdl2_event::EguiSDL2State;
use sdl2::event::{Event, WindowEvent};
use sdl2::keyboard::Keycode;
Expand Down
3 changes: 1 addition & 2 deletions examples/sdl2_vulkan.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// This example shows how to use the renderer with SDL2 directly.

use egui_sdl2_event::DpiMode;

#[cfg(feature = "vulkan")]
fn main() {
use egui_sdl2_event::DpiMode;
use egui_sdl2_event::EguiSDL2State;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ mod egui_skia_winit;
#[cfg(feature = "winit")]
pub use egui_skia_winit::EguiSkiaWinit;

pub use egui_skia::*;
pub use crate::egui_skia::*;
pub use painter::EguiSkiaPaintCallback;

0 comments on commit 08745f7

Please sign in to comment.