This commit is contained in:
47
.gitea/workflows/ci.yml
Normal file
47
.gitea/workflows/ci.yml
Normal file
@ -0,0 +1,47 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master, develop ]
|
||||
pull_request:
|
||||
branches: [ main, master, develop ]
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
container:
|
||||
image: rust:latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Additional Components
|
||||
run: rustup component add rustfmt clippy
|
||||
|
||||
- name: Cache Cargo Dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
target/
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-
|
||||
|
||||
- name: Check Formatting
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
- name: Run Clippy
|
||||
run: cargo clippy --all-targets --all-features -- -D warnings
|
||||
|
||||
- name: Run Tests
|
||||
run: cargo test --verbose
|
||||
|
||||
- name: Build Project
|
||||
run: cargo build --verbose --release
|
||||
|
||||
- name: Build Binary
|
||||
run: cargo build --bin precdu --release
|
Reference in New Issue
Block a user