add ci
All checks were successful
tests / fmt (push) Successful in 3m43s
tests / clippy (push) Successful in 6m13s
tests / build (push) Successful in 2m28s

This commit is contained in:
2024-06-08 23:39:26 +02:00
parent 431fb25d85
commit 6dd58ee2a1
3 changed files with 60 additions and 7 deletions

56
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,56 @@
name: tests
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
sudo apt-get update
sudo apt-get install mingw-w64 -y
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: x86_64-pc-windows-gnu
components: rustfmt
- name: Rustfmt Check
uses: actions-rust-lang/rustfmt@v1
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
sudo apt-get update
sudo apt-get install mingw-w64 -y
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: x86_64-pc-windows-gnu
components: clippy
- name: Run clippy
run: cargo clippy --target x86_64-pc-windows-gnu
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
sudo apt-get update
sudo apt-get install mingw-w64 -y
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: x86_64-pc-windows-gnu
- name: Build
run: cargo build --verbose --release --target x86_64-pc-windows-gnu
- name: Create release
uses: softprops/action-gh-release@v2
if: startsWith(gitea.ref, 'refs/tags/')
with:
files: |
target/x86_64-pc-windows-gnu/release/space.exe

View File

@@ -2,4 +2,4 @@ extern crate embed_resource;
fn main() {
embed_resource::compile("tray-example.rc", embed_resource::NONE);
}
}

View File

@@ -85,16 +85,13 @@ fn tray() {
.unwrap();
loop {
match rx.recv() {
Ok(TrayMessage::Quit) => {
break;
}
_ => {}
if let Ok(TrayMessage::Quit) = rx.recv() {
break;
}
}
}
fn main() {
thread::spawn(|| play_sound_while_holding_space());
thread::spawn(play_sound_while_holding_space);
tray();
}