diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 15d20ff..5c76514 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -2,37 +2,37 @@ name: CI on: push: - branches: [main, master] + branches: [main] pull_request: - branches: [main, master] - -concurrency: - group: ${{ gitea.workflow }}-${{ gitea.ref }} - cancel-in-progress: true + branches: [main] jobs: - lint-and-test: + lint-and-build: runs-on: ubuntu-latest + container: + image: ubuntu:22.04 + env: + DEBIAN_FRONTEND: noninteractive steps: - uses: actions/checkout@v4 - - name: Install Linux dependencies + - name: Install system dependencies run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev + apt-get update + apt-get install -y \ + build-essential curl wget pkg-config \ + libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev \ + libssl-dev git ca-certificates - - uses: dtolnay/rust-toolchain@stable - with: - components: clippy, rustfmt + - name: Install Node.js 22 + run: | + curl -fsSL https://deb.nodesource.com/setup_22.x | bash - + apt-get install -y nodejs - - uses: Swatinem/rust-cache@v2 - with: - workspaces: src-tauri - - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm + - name: Install Rust toolchain + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --component clippy,rustfmt + echo "$HOME/.cargo/bin" >> $GITHUB_PATH - name: Install frontend dependencies run: npm ci @@ -41,51 +41,21 @@ jobs: run: npm run lint - name: Rust fmt check - run: cd src-tauri && cargo fmt --check + run: | + . "$HOME/.cargo/env" + cd src-tauri && cargo fmt --check - name: Rust clippy - run: cd src-tauri && cargo clippy -- -D warnings + run: | + . "$HOME/.cargo/env" + cd src-tauri && cargo clippy -- -D warnings - name: Rust tests - run: cd src-tauri && cargo test - - - name: Frontend tests - run: npm test - - build: - needs: lint-and-test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install Linux dependencies run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev - - - uses: dtolnay/rust-toolchain@stable - - - uses: Swatinem/rust-cache@v2 - with: - workspaces: src-tauri - - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm - - - name: Install frontend dependencies - run: npm ci + . "$HOME/.cargo/env" + cd src-tauri && cargo test - name: Build Tauri app - run: npm run tauri build - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: tusk-linux-x64 - path: | - src-tauri/target/release/bundle/deb/*.deb - src-tauri/target/release/bundle/rpm/*.rpm - src-tauri/target/release/bundle/appimage/*.AppImage - if-no-files-found: ignore + run: | + . "$HOME/.cargo/env" + npm run tauri build diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 6b25c56..5cd3d33 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -8,30 +8,38 @@ on: jobs: release: runs-on: ubuntu-latest + container: + image: ubuntu:22.04 + env: + DEBIAN_FRONTEND: noninteractive steps: - uses: actions/checkout@v4 - - name: Install Linux dependencies + - name: Install system dependencies run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev + apt-get update + apt-get install -y \ + build-essential curl wget pkg-config jq file \ + libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev \ + libssl-dev git ca-certificates - - uses: dtolnay/rust-toolchain@stable + - name: Install Node.js 22 + run: | + curl -fsSL https://deb.nodesource.com/setup_22.x | bash - + apt-get install -y nodejs - - uses: Swatinem/rust-cache@v2 - with: - workspaces: src-tauri - - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm + - name: Install Rust toolchain + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable + echo "$HOME/.cargo/bin" >> $GITHUB_PATH - name: Install frontend dependencies run: npm ci - name: Build Tauri app - run: npm run tauri build + run: | + . "$HOME/.cargo/env" + npm run tauri build - name: Create release and upload assets env: diff --git a/Makefile b/Makefile index 3fb782c..dd66a7e 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ TARGET_DIR := $(if $(TARGET),src-tauri/target/$(TARGET)/release,src-tauri/targe # ────────────────────────────────────────────── .PHONY: dev -dev: node_modules ## Run app in dev mode (Vite HMR + Rust backend) +dev: ## Run app in dev mode (Vite HMR + Rust backend) npm run tauri dev .PHONY: dev-frontend @@ -98,12 +98,14 @@ export DESKTOP_ENTRY .PHONY: install install: build ## Build release and install to system (PREFIX=/usr/local) - install -Dm755 $(TARGET_DIR)/$(APP_NAME) $(DESTDIR)$(BINDIR)/$(APP_NAME) + @mkdir -p $(DESTDIR)$(BINDIR) + install -m755 $(TARGET_DIR)/$(APP_NAME) $(DESTDIR)$(BINDIR)/$(APP_NAME) @mkdir -p $(DESTDIR)$(DATADIR)/applications @echo "$$DESKTOP_ENTRY" > $(DESTDIR)$(DATADIR)/applications/$(APP_NAME).desktop @for size in 32x32 128x128; do \ if [ -f src-tauri/icons/$$size.png ]; then \ - install -Dm644 src-tauri/icons/$$size.png \ + mkdir -p $(DESTDIR)$(DATADIR)/icons/hicolor/$$size/apps; \ + install -m644 src-tauri/icons/$$size.png \ $(DESTDIR)$(DATADIR)/icons/hicolor/$$size/apps/$(APP_NAME).png; \ fi; \ done diff --git a/eslint.config.js b/eslint.config.js index 5e6b472..483d5e2 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -6,7 +6,7 @@ import tseslint from 'typescript-eslint' import { defineConfig, globalIgnores } from 'eslint/config' export default defineConfig([ - globalIgnores(['dist']), + globalIgnores(['dist', 'src-tauri']), { files: ['**/*.{ts,tsx}'], extends: [ @@ -19,5 +19,8 @@ export default defineConfig([ ecmaVersion: 2020, globals: globals.browser, }, + rules: { + 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], + }, }, ]) diff --git a/index.html b/index.html index d901d62..412e2f8 100644 --- a/index.html +++ b/index.html @@ -1,9 +1,12 @@ - +
+ Connect to a database to browse schema +