Files
nuchat/.gitea/workflows/cargo.yaml
Fergus Molloy f09f89405a
Some checks failed
Cargo / check (push) Successful in 1m16s
Cargo / test (push) Successful in 1m55s
Cargo / build (push) Has been cancelled
small change
2025-07-18 13:28:54 +01:00

66 lines
1.7 KiB
YAML

name: Cargo
run-name: ${{ gitea.actor }} is verifying cargo build and tests
on: [push]
jobs:
build:
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: rust-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: '1.24'
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: get-hash
with:
patterns: Cargo.toml
- name: Echo hash
run: echo "hash is ${{ steps.get-hash.outputs.hash }}"
- name: cache go
id: cache-go
uses: actions/cache@v3
with: # Specify with your cache path
path: |
~/.cargo/registry
target
key: go_path-${{ steps.hash-go.outputs.hash }}
restore-keys: |-
go_cache-${{ steps.hash-go.outputs.hash }}
- name: Build project
uses: actions-rs/cargo@v1
with:
command: build
args: --release
check:
runs-on: rust-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -Dwarnings -Wclippy::correctness -Wclippy::complexity -Wclippy::perf -Aclippy::missing_errors_doc -Aclippy::missing_panics_doc
test:
runs-on: rust-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: test
args: --lib --bins
- name: Run integration tests
uses: actions-rs/cargo@v1
with:
command: test
args: --tests '*'