diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..fefe081 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: actions/setup-rust@v1 + with: + rust-version: stable + + - name: Cache cargo + 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: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libgit2-dev pkg-config libssl-dev + + - name: Build + run: cargo build --all-features + + - name: Run tests + run: cargo test --all + + - name: Run clippy + run: cargo clippy --all-features -- -D warnings + + - name: Check formatting + run: cargo fmt --all -- --check