-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
1,316 additions
and
792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: "cargo" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
timezone: "Europe/Warsaw" | ||
day: "friday" | ||
time: "18:00" | ||
- package-ecosystem: "cargo" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
timezone: "Europe/Warsaw" | ||
day: "friday" | ||
time: "18:00" | ||
|
||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
timezone: "Europe/Warsaw" | ||
day: "friday" | ||
time: "18:00" | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
timezone: "Europe/Warsaw" | ||
day: "friday" | ||
time: "18:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: ci & cd | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" # Trigger on main branch. | ||
tags: | ||
- "v*.*.*" # Trigger on semantic version tags. | ||
pull_request: # Validation only (without pushing). | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
|
||
- name: Run Cargo:fmt | ||
run: cargo +nightly fmt --all -- --check | ||
|
||
- name: Run Cargo:clippy | ||
run: cargo clippy --all-features -- -D warnings | ||
|
||
- name: Run Cargo:test | ||
run: cargo test --verbose --all-features | ||
|
||
publish: | ||
runs-on: ubuntu-22.04 | ||
if: github.event_name == 'push' | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
|
||
- name: Publish | ||
run: cargo publish --token ${CRATES_TOKEN} | ||
env: | ||
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ output/ | |
build/ | ||
|
||
# Generated | ||
/crates/database/entities/ | ||
crates/runtime/protobuf/ | ||
|
||
# Binaries | ||
*.exe | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,42 @@ | ||
// TODO: Move initialize_tracing here | ||
|
||
#[must_use] | ||
fn build_env_filter() -> tracing_subscriber::EnvFilter { | ||
let current = std::env::var("RUST_LOG") | ||
.or_else(|_| std::env::var("OTEL_LOG_LEVEL")) | ||
.unwrap_or_else(|_| "info".to_string()); | ||
|
||
let env = format!("{},server=trace,otel=debug,tower_http=debug", current); | ||
std::env::set_var("RUST_LOG", env); | ||
tracing_subscriber::EnvFilter::from_default_env() | ||
} | ||
|
||
pub async fn initialize_tracing() -> anyhow::Result<()> { | ||
use tracing_subscriber::fmt::layer; | ||
use tracing_subscriber::layer::SubscriberExt; | ||
use tracing_subscriber::util::SubscriberInitExt; | ||
|
||
// Setups a temporary subscriber to log output during setup. | ||
let env_filter = build_env_filter(); | ||
let fmt_layer = layer().pretty(); | ||
let subscriber = tracing_subscriber::registry() | ||
.with(env_filter) | ||
.with(fmt_layer); | ||
|
||
let _guard = tracing::subscriber::set_default(subscriber); | ||
tracing::trace!(target: "server:otel", "initialized temporary subscriber"); | ||
|
||
// TODO: Enable OpenTelemetry. | ||
// https://github.com/davidB/tracing-opentelemetry-instrumentation-sdk | ||
|
||
// Setups an actual subscriber. | ||
let env_filter = build_env_filter(); | ||
let fmt_layer = layer().pretty(); | ||
tracing_subscriber::registry() | ||
.with(env_filter) | ||
.with(fmt_layer) | ||
.init(); | ||
|
||
tracing::trace!(target: "server:otel", "initialized subscriber"); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.