mirror of
https://github.com/flectar/mail.git
synced 2026-11-13 10:34:15 +00:00
149 lines
5.5 KiB
YAML
149 lines
5.5 KiB
YAML
name: Quality and security
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
schedule:
|
|
- cron: "17 4 * * *"
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: quality-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
CARGO_BUILD_JOBS: "2"
|
|
|
|
jobs:
|
|
quality:
|
|
if: github.event_name != 'schedule'
|
|
name: Format, lint, and test
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
|
|
- name: Install native build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
build-essential \
|
|
gettext \
|
|
libdbus-1-dev \
|
|
libfontconfig1-dev \
|
|
libx11-dev \
|
|
libx11-xcb-dev \
|
|
libxcb-shape0-dev \
|
|
libxcb-xfixes0-dev \
|
|
libxcursor-dev \
|
|
libxkbcommon-dev \
|
|
libxkbcommon-x11-dev \
|
|
pkg-config \
|
|
ripgrep
|
|
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
|
|
with:
|
|
toolchain: stable
|
|
components: clippy,rustfmt
|
|
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
|
|
with:
|
|
key: quality-default
|
|
- name: Check formatting
|
|
run: cargo fmt --all -- --check
|
|
- name: Validate repository support files
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
find scripts -type f -name '*.sh' -print0 | xargs -0 -n1 bash -n
|
|
python3 - <<'PY'
|
|
import ast
|
|
import json
|
|
import xml.etree.ElementTree as ET
|
|
from pathlib import Path
|
|
|
|
for path in Path("scripts").glob("*.py"):
|
|
ast.parse(path.read_text(encoding="utf-8"), filename=str(path))
|
|
for path in Path(".").glob("**/*.json"):
|
|
if "target" not in path.parts:
|
|
json.loads(path.read_text(encoding="utf-8"))
|
|
for path in Path(".").glob("**/*.xml"):
|
|
if "target" not in path.parts:
|
|
ET.parse(path)
|
|
PY
|
|
- name: Verify the Blitz patch queue
|
|
run: bash scripts/blitz-patches.sh verify
|
|
- name: Test release validation and publication
|
|
run: python3 scripts/test-release.py
|
|
- name: Reject unused direct dependencies
|
|
run: |
|
|
cargo install cargo-machete --locked --version 0.9.2
|
|
cargo machete --with-metadata
|
|
- name: Check every default target
|
|
run: cargo check --workspace --all-targets --locked
|
|
- name: Check the capability-minimal application
|
|
run: cargo check -p flectar-mail --no-default-features --locked
|
|
- name: Check the opt-in GPU renderer
|
|
run: cargo check -p flectar-mail --no-default-features --features remote-content,gpu-renderer --locked
|
|
- name: Lint without warnings
|
|
run: cargo clippy --workspace --all-targets --locked -- -D warnings
|
|
- name: Validate the Spanish catalog
|
|
shell: bash
|
|
run: |
|
|
cargo install slint-tr-extractor --version 1.17.1 --locked
|
|
bash scripts/check-translations.sh
|
|
msgfmt --check --check-header --check-format \
|
|
-o /tmp/flectar-mail-es.mo \
|
|
lang/es/LC_MESSAGES/flectar-mail.po
|
|
test -z "$(msgattrib --untranslated --no-obsolete lang/es/LC_MESSAGES/flectar-mail.po)"
|
|
test -z "$(msgattrib --only-fuzzy --no-obsolete lang/es/LC_MESSAGES/flectar-mail.po)"
|
|
test -z "$(msgattrib --only-obsolete lang/es/LC_MESSAGES/flectar-mail.po)"
|
|
- name: Run the default test suite
|
|
run: cargo test --workspace --all-targets --locked
|
|
|
|
optional-embeddings:
|
|
if: github.event_name != 'schedule'
|
|
name: Optional embedding runtime
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
|
|
- name: Install native core dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y build-essential libdbus-1-dev pkg-config
|
|
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
|
|
with:
|
|
key: quality-embeddings
|
|
- name: Lint the opt-in model runtime
|
|
run: cargo clippy -p flectar-mail-core --all-targets --locked --features local-embeddings -- -D warnings
|
|
- name: Test the opt-in model runtime
|
|
run: cargo test -p flectar-mail-core --lib --locked --features local-embeddings
|
|
|
|
rustsec:
|
|
name: RustSec advisory scan
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
|
|
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
|
|
with:
|
|
toolchain: stable
|
|
- name: Install pinned cargo-audit
|
|
run: cargo install cargo-audit --locked --version 0.22.2
|
|
- name: Audit the locked dependency graph
|
|
# These four advisories are unmaintained notices in optional/build or
|
|
# Slint/Blitz typography dependencies. Deny every new warning while the
|
|
# upstream replacements are tracked explicitly here.
|
|
run: |
|
|
cargo audit --file Cargo.lock --deny warnings \
|
|
--ignore RUSTSEC-2025-0141 \
|
|
--ignore RUSTSEC-2024-0436 \
|
|
--ignore RUSTSEC-2026-0206 \
|
|
--ignore RUSTSEC-2026-0192
|