Move rust checks to own file

This commit is contained in:
Jai A
2024-10-18 15:43:30 -07:00
parent 1b73d248b3
commit c143929b69
9 changed files with 38 additions and 66 deletions

35
.github/workflows/rust-ci.yml vendored Normal file
View File

@@ -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

View File

@@ -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 }}

View File

@@ -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

View File

@@ -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"
}
}

View File

@@ -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"

View File

@@ -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"]

View File

@@ -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": {
}
}

View File

@@ -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(

View File

@@ -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"
}
}