diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml new file mode 100644 index 00000000..f138e544 --- /dev/null +++ b/.github/workflows/rust-ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + types: [opened, synchronize] + merge_group: + types: [ checks_requested ] + +env: + CARGO_TERM_COLOR: always + SQLX_OFFLINE: true + +jobs: + build: + name: Build and Lint (Rust) + runs-on: ubuntu-22.04 + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Get build cache + id: cache-build + uses: actions/cache@v2 + with: + path: target/** + key: ${{ runner.os }}-rust-cache + + - name: Build + run: cargo build + + - name: Lint + run: cargo clippy --all-targets --all-features -- -D warnings \ No newline at end of file diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml deleted file mode 100644 index b00d0ff0..00000000 --- a/.github/workflows/security.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Security audit - -on: - push: - paths: - - '**/Cargo.toml' - - '**/Cargo.lock' - pull_request: - paths: - - '**/Cargo.toml' - - '**/Cargo.lock' - -jobs: - security_audit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions-rs/audit-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/turbo-ci.yml similarity index 94% rename from .github/workflows/ci.yml rename to .github/workflows/turbo-ci.yml index 4ff6b80d..0e510c66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/turbo-ci.yml @@ -10,7 +10,7 @@ on: jobs: build: - name: Build, Test, and Lint + name: Build, Test, and Lint (Turbo) runs-on: ubuntu-22.04 steps: @@ -66,8 +66,5 @@ jobs: - name: Lint run: pnpm lint - - name: Start Docker Compose - run: docker compose up -d - - name: Test run: pnpm test diff --git a/apps/app-playground/package.json b/apps/app-playground/package.json deleted file mode 100644 index 4e4825b8..00000000 --- a/apps/app-playground/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "@modrinth/app-playground", - "scripts": { - "build": "cargo build --release", - "lint": "cargo fmt --check && cargo clippy -- -D warnings", - "fix": "cargo fmt && cargo clippy --fix", - "dev": "cargo run", - "test": "cargo test" - } -} diff --git a/apps/app/package.json b/apps/app/package.json index 30d9cfff..6b3c3547 100644 --- a/apps/app/package.json +++ b/apps/app/package.json @@ -3,10 +3,7 @@ "scripts": { "build": "tauri build", "tauri": "tauri", - "dev": "tauri dev", - "test": "cargo test", - "lint": "cargo fmt --check && cargo clippy -- -D warnings", - "fix": "cargo fmt && cargo clippy --fix" + "dev": "tauri dev" }, "devDependencies": { "@tauri-apps/cli": "2.0.0-rc.16" diff --git a/apps/labrinth/Cargo.toml b/apps/labrinth/Cargo.toml index a63dd1c6..2a8a0c0e 100644 --- a/apps/labrinth/Cargo.toml +++ b/apps/labrinth/Cargo.toml @@ -120,11 +120,5 @@ json-patch = "*" [dev-dependencies] actix-http = "3.4.0" -[profile.dev] -opt-level = 0 # Minimal optimization, speeds up compilation -lto = false # Disables Link Time Optimization -incremental = true # Enables incremental compilation -codegen-units = 16 # Higher number can improve compile times but reduce runtime performance - [features] jemalloc = ["jemallocator"] \ No newline at end of file diff --git a/apps/labrinth/package.json b/apps/labrinth/package.json deleted file mode 100644 index 49dea0c8..00000000 --- a/apps/labrinth/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "@modrinth/labrinth", - "scripts": { - "build": "cargo build", - "dev": "cargo run", - "test": "cargo test", - "lint": "cargo fmt --check && cargo clippy -- -D warnings", - "fix": "cargo fmt && cargo clippy --fix" - }, - "dependencies": { - } -} diff --git a/apps/labrinth/src/routes/internal/billing.rs b/apps/labrinth/src/routes/internal/billing.rs index b0c544d3..1332fa3b 100644 --- a/apps/labrinth/src/routes/internal/billing.rs +++ b/apps/labrinth/src/routes/internal/billing.rs @@ -290,7 +290,7 @@ pub async fn edit_subscription( intent.setup_future_usage = Some(PaymentIntentSetupFutureUsage::OffSession); if let Some(payment_method) = &edit_subscription.payment_method { - let payment_method_id = if let Ok(id) = PaymentMethodId::from_str(&payment_method) { + let payment_method_id = if let Ok(id) = PaymentMethodId::from_str(payment_method) { id } else { return Err(ApiError::InvalidInput( diff --git a/packages/app-lib/package.json b/packages/app-lib/package.json deleted file mode 100644 index b674c825..00000000 --- a/packages/app-lib/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@modrinth/app-lib", - "scripts": { - "build": "cargo build --release", - "lint": "cargo fmt --check && cargo clippy -- -D warnings", - "fix": "cargo fmt && cargo clippy --fix", - "test": "cargo test" - } -}