add ci
This commit is contained in:
56
.gitea/workflows/ci.yml
Normal file
56
.gitea/workflows/ci.yml
Normal 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
|
||||
2
build.rs
2
build.rs
@@ -2,4 +2,4 @@ extern crate embed_resource;
|
||||
|
||||
fn main() {
|
||||
embed_resource::compile("tray-example.rc", embed_resource::NONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user