Initial implementation #1

Merged
dzu merged 7 commits from forgejo-openapi-generator into master 2026-02-11 06:36:51 +01:00
5 changed files with 65 additions and 3 deletions
Showing only changes of commit 0f301b15f5 - Show all commits

minimal forgejo openapi test

also example setup to compile this thing
Artem Diachenko 2026-02-08 21:04:07 +00:00

View file

@ -1,3 +1,19 @@
[workspace]
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
View 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
```

View 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"] }

View 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:#?}");
}

View file

@ -11,9 +11,9 @@ serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0"
serde_repr = "^0.1"
url = "^2.5"
tokio = { version = "^1.46.0", features = ["fs"] }
tokio = { workspace = true, features = ["fs"] }
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]
default = ["native-tls"]