ci: split CI jobs, add clippy/test, upgrade actions
- Split single check job into frontend / rust / jdbc parallel jobs - Add concurrency group to cancel redundant CI runs - Add pnpm cache via setup-node - Add cargo clippy and cargo test to CI - Unify Node version to 22 across all workflows - Upgrade pnpm/action-setup to v6 - Fix clippy never_loop errors (while let → if let)
This commit is contained in:
+39
-11
@@ -6,23 +6,26 @@ on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check:
|
||||
frontend:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.13.0
|
||||
cache: pnpm
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
uses: pnpm/action-setup@v6
|
||||
|
||||
- name: Install system dependencies (Linux)
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev libsecret-1-dev
|
||||
@@ -45,15 +48,20 @@ jobs:
|
||||
- name: Node package publish dry run
|
||||
run: pnpm publish:dry-run
|
||||
|
||||
rust:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev libsecret-1-dev
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '17'
|
||||
cache: maven
|
||||
components: clippy
|
||||
|
||||
- name: Rust cache
|
||||
uses: swatinem/rust-cache@v2
|
||||
@@ -64,9 +72,29 @@ jobs:
|
||||
- name: Cargo fmt check
|
||||
run: cargo fmt --check
|
||||
|
||||
- name: Cargo clippy
|
||||
run: cargo clippy --workspace --locked
|
||||
|
||||
- name: Cargo check
|
||||
run: cargo check --workspace --locked
|
||||
|
||||
- name: Cargo test
|
||||
run: cargo test --workspace --locked
|
||||
|
||||
jdbc:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '17'
|
||||
cache: maven
|
||||
|
||||
- name: JDBC plugin version guard
|
||||
env:
|
||||
BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
|
||||
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
- uses: pnpm/action-setup@v4
|
||||
- uses: pnpm/action-setup@v6
|
||||
- run: cd docs && pnpm install --frozen-lockfile --ignore-workspace && pnpm build
|
||||
- name: Deploy to Cloudflare Workers
|
||||
working-directory: docs
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
uses: pnpm/action-setup@v6
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
|
||||
@@ -73,10 +73,10 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
uses: pnpm/action-setup@v6
|
||||
|
||||
- name: Install frontend dependencies
|
||||
run: pnpm install
|
||||
|
||||
@@ -139,7 +139,7 @@ pub async fn import_agents_from_zip(
|
||||
let tmp_dir = state.data_dir.join("tmp");
|
||||
std::fs::create_dir_all(&tmp_dir).map_err(|err| AppError(err.to_string()))?;
|
||||
|
||||
while let Some(field) = multipart.next_field().await.map_err(|err| AppError(err.to_string()))? {
|
||||
if let Some(field) = multipart.next_field().await.map_err(|err| AppError(err.to_string()))? {
|
||||
let file_name = field.file_name().unwrap_or("offline-drivers.zip").to_string();
|
||||
if !file_name.to_ascii_lowercase().ends_with(".zip") {
|
||||
return Err(AppError("Offline driver package must be a .zip file".to_string()));
|
||||
|
||||
@@ -42,7 +42,7 @@ pub async fn preview_sql_file(
|
||||
let tmp_dir = state.data_dir.join("tmp");
|
||||
std::fs::create_dir_all(&tmp_dir).map_err(|e| AppError(e.to_string()))?;
|
||||
|
||||
while let Some(field) = multipart.next_field().await.map_err(|e| AppError(e.to_string()))? {
|
||||
if let Some(field) = multipart.next_field().await.map_err(|e| AppError(e.to_string()))? {
|
||||
let file_name = field.file_name().unwrap_or("upload.sql").to_string();
|
||||
let data = field.bytes().await.map_err(|e| AppError(e.to_string()))?;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ pub async fn preview_import(
|
||||
let tmp_dir = state.data_dir.join("tmp");
|
||||
std::fs::create_dir_all(&tmp_dir).map_err(|e| AppError(e.to_string()))?;
|
||||
|
||||
while let Some(field) = multipart.next_field().await.map_err(|e| AppError(e.to_string()))? {
|
||||
if let Some(field) = multipart.next_field().await.map_err(|e| AppError(e.to_string()))? {
|
||||
let file_name = field.file_name().unwrap_or("upload.csv").to_string();
|
||||
let data = field.bytes().await.map_err(|e| AppError(e.to_string()))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user