Initial implementation #1
5 changed files with 65 additions and 3 deletions
minimal forgejo openapi test
also example setup to compile this thing
commit
0f301b15f5
18
Cargo.toml
18
Cargo.toml
|
|
@ -1,3 +1,19 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
resolver = "3"
|
resolver = "3"
|
||||||
members = [ "forgejo-openapi" ]
|
members = [
|
||||||
|
"forgejo-openapi",
|
||||||
|
"forgejo-openapi-test"
|
||||||
|
]
|
||||||
|
|
||||||
|
[workspace.dependencies]
|
||||||
|
# workspace
|
||||||
|
forgejo-openapi = { path = "./forgejo-openapi", default-features = false }
|
||||||
|
# external
|
||||||
|
tokio = { version = "^1.46.0", default-features = false }
|
||||||
|
reqwest = { version = "^0.12", default-features = false }
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
opt-level = "z"
|
||||||
|
strip = true
|
||||||
|
lto = true
|
||||||
|
codegen-units = 1
|
||||||
|
|
|
||||||
16
README.md
Normal file
16
README.md
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
Rust toolkit for CI actions
|
||||||
|
|
||||||
|
anode -- action without node
|
||||||
|
|
||||||
|
# Compile
|
||||||
|
|
||||||
|
install
|
||||||
|
- libunwind-static
|
||||||
|
- xz-static
|
||||||
|
|
||||||
|
get C runtime libraries from somewhere (I literally copied them from whatever `gcc` found them in on my system; I think that on actual alpine system they will be found with no problem)
|
||||||
|
|
||||||
|
test is compiled with the following command:
|
||||||
|
```sh
|
||||||
|
RUSTFLAGS="-Lunwind -L/lib/musl/lib -Lcrt -Lxz -llzma" cargo +nightly b -Z build-std -p tests --release --target x86_64-unknown-linux-musl -v
|
||||||
|
```
|
||||||
10
forgejo-openapi-test/Cargo.toml
Normal file
10
forgejo-openapi-test/Cargo.toml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
[package]
|
||||||
|
name = "forgejo-openapi-test"
|
||||||
|
publish = false
|
||||||
|
version = "0.0.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
forgejo-openapi = { workspace = true, features = ["rustls-tls"] }
|
||||||
|
reqwest = { workspace = true }
|
||||||
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
20
forgejo-openapi-test/src/main.rs
Normal file
20
forgejo-openapi-test/src/main.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#[tokio::main(flavor = "current_thread")]
|
||||||
|
async fn main() {
|
||||||
|
let client = reqwest::Client::new();
|
||||||
|
let config = forgejo_openapi::apis::configuration::Configuration {
|
||||||
|
base_path: String::from("https://git.dzuchun.ing/api/v1"),
|
||||||
|
user_agent: None,
|
||||||
|
client,
|
||||||
|
basic_auth: None,
|
||||||
|
oauth_access_token: None,
|
||||||
|
bearer_access_token: None,
|
||||||
|
api_key: None,
|
||||||
|
};
|
||||||
|
let results = forgejo_openapi::apis::repository_api::repo_search(
|
||||||
|
&config, None, None, None, None, None, None, None, None, None, None, None, None, None,
|
||||||
|
None, None, None, None,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{results:#?}");
|
||||||
|
}
|
||||||
|
|
@ -11,9 +11,9 @@ serde = { version = "^1.0", features = ["derive"] }
|
||||||
serde_json = "^1.0"
|
serde_json = "^1.0"
|
||||||
serde_repr = "^0.1"
|
serde_repr = "^0.1"
|
||||||
url = "^2.5"
|
url = "^2.5"
|
||||||
tokio = { version = "^1.46.0", features = ["fs"] }
|
tokio = { workspace = true, features = ["fs"] }
|
||||||
tokio-util = { version = "^0.7", features = ["codec"] }
|
tokio-util = { version = "^0.7", features = ["codec"] }
|
||||||
reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "stream"] }
|
reqwest = { workspace = true, features = ["json", "multipart", "stream"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["native-tls"]
|
default = ["native-tls"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue