Skip to content

Commit

Permalink
Add github actions CI files (#12)
Browse files Browse the repository at this point in the history
* Add github actions CI files

* Only run CI on commit pushes

* Fix a redundant binding

* Add missing packages for the CI test step
  • Loading branch information
bschwind committed Feb 25, 2024
1 parent 7f8c353 commit 8677226
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on: [push]

name: Cargo Clippy

jobs:
clippy:
name: Cargo Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings
20 changes: 20 additions & 0 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on: [push]

name: Cargo Format

jobs:
fmt:
name: Cargo Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on: [push]

name: Cargo Test

jobs:
test:
name: Cargo Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install packages (Linux)
#TODO(emilk) use upstream when https://github.com/awalsh128/cache-apt-pkgs-action/pull/90 is merged
uses: awalsh128/cache-apt-pkgs-action
with:
packages: libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev libgtk-3-dev # libgtk-3-dev is used by rfd
version: 1.0
execute_install_scripts: true
- uses: actions-rs/cargo@v1
with:
command: test
2 changes: 1 addition & 1 deletion examples/gui/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn main() -> Result<()> {
let should_exit = Arc::new(AtomicBool::new(false));
thread::spawn({
let mut panel = panel::Panel::new(port)?;
let should_exit = should_exit;

move || loop {
match panel.poll() {
Ok(reports) => {
Expand Down

0 comments on commit 8677226

Please sign in to comment.