fix: add Rust/Cargo CI workflow for gitpulse project
Some checks failed
CI / build (push) Failing after 3m41s
CI / lint (push) Failing after 2m45s
CI / format (push) Failing after 36s

This commit is contained in:
2026-02-04 15:48:28 +00:00
parent 043754c111
commit cbafec8b5e

View File

@@ -2,54 +2,68 @@ name: CI
on:
push:
branches: [main, master]
branches: [main]
pull_request:
branches: [main, master]
branches: [main]
jobs:
test:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions/setup-rust@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
rust-version: '1.70'
cache: true
toolchain: stable
profile: minimal
override: true
- name: Build
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgit2-dev pkg-config
- name: Build project
run: cargo build --release
- name: Run tests
run: cargo test
run: cargo test --all
- name: Check formatting
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
release:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions/setup-rust@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
rust-version: '1.70'
cache: true
toolchain: stable
profile: minimal
override: true
- name: Build release
run: cargo build --release
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgit2-dev pkg-config
- name: Create Release
uses: https://gitea.com/actions/release-action@main
- name: Run clippy
uses: actions-rs/cargo@v1
with:
files: |
target/release/gitpulse
name: ${{ github.ref_name }}
body: "Release ${{ github.ref_name }}"
command: clippy
args: --all-features -- -D warnings
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Check formatting
run: cargo fmt --all -- --check