Add Gitea Actions workflow: ci.yml
Some checks failed
CI / test (push) Failing after 54s
CI / build (push) Has been skipped
CI / lint (push) Failing after 38s

This commit is contained in:
2026-02-04 04:39:42 +00:00
parent 26372cbbe8
commit cd603b93ff

87
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,87 @@
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: Clippy
args: -- -D warnings
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: Test
args: --all -- --nocapture
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: ./target/debug/coverage.tar.gz
fail_ci_if_error: false
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Build release
uses: actions-rs/cargo@v1
with:
command: Build
args: --release
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: gitignore-gen
path: target/release/gitignore-gen
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Check formatting
run: cargo fmt --check --all
- name: Check clippy
run: cargo clippy --all-targets --all-features -- -D warnings