GitHub workflow: Test the player script extractor every 2 hours

This commit is contained in:
techmetx11 2024-08-09 15:09:05 +01:00
parent 152b972b62
commit f7cbcbddfa
No known key found for this signature in database
GPG Key ID: E60B63635FF4E062
2 changed files with 12 additions and 2 deletions

View File

@ -5,6 +5,9 @@ on:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
# every 2 hours
- cron: "0 */2 * * *"
env:
CARGO_TERM_COLOR: always
@ -18,5 +21,5 @@ jobs:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Test server
run: target/debug/inv_sig_helper_rust --test

View File

@ -65,6 +65,13 @@ async fn main() {
}
};
loop_main!(tcp_socket, state);
} else if socket_url == "--test" {
// TODO: test the API aswell, this only tests the player script extractor
println!("Fetching player");
match fetch_update(state.clone()).await {
Ok(()) => std::process::exit(0),
Err(_x) => std::process::exit(-1),
}
} else {
let unix_socket = match UnixListener::bind(socket_url) {
Ok(x) => x,