From 568f2271a888c18e197d311b1ca38254f5473395 Mon Sep 17 00:00:00 2001 From: temrjan Date: Thu, 4 Jun 2026 14:55:16 +0500 Subject: [PATCH] ci: add GitHub Actions (fmt, clippy, test, security audit) - fmt / clippy (-D warnings, pedantic) / test / cargo-audit jobs on push+PR to main - ubuntu-latest installs egui system libs (mesa/xkbcommon/wayland/xcb) so the GUI crate compiles - SHA-pinned actions, concurrency cancel, least-privilege permissions, Swatinem/rust-cache - style follows rustok-org/core CI --- .github/workflows/ci.yml | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..04272d7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: CI + +on: + pull_request: + branches: [main] + push: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +env: + CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: 0 + +jobs: + fmt: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: dtolnay/rust-toolchain@stable + with: { components: rustfmt } + - run: cargo fmt --all --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Install egui system libraries + run: | + sudo apt-get update + sudo apt-get install -y \ + libgl1-mesa-dev libxkbcommon-dev libwayland-dev \ + libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev + - uses: dtolnay/rust-toolchain@stable + with: { components: clippy } + - uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 + - run: cargo clippy --workspace --all-targets -- -D warnings + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Install egui system libraries + run: | + sudo apt-get update + sudo apt-get install -y \ + libgl1-mesa-dev libxkbcommon-dev libwayland-dev \ + libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7 + - run: cargo test --workspace + + audit: + name: Security Audit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: rustsec/audit-check@69366f33c96575abad1ee0dba8212993eecbe998 # v2.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }}