Skip to content

Add CLAUDE.md

Add CLAUDE.md #1

Workflow file for this run

name: Rust CI
on:
push:
branches:
- master
- 'auto-updates/**'
pull_request: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
check_for_changes:
name: Check Rust Changes
runs-on: ubuntu-latest
outputs:
rust_changes: ${{ steps.changed-files.outputs.any_modified }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
lfs: false
- name: Get changed files
id: changed-files
# tj-actions/changed-files - pinned it a git hash for maximum safety, managed by dependabot
uses: tj-actions/changed-files@f7a56405a89ea095c6230f10e7f1c49daab13b35
with:
files: |
src/rust/**
.github/**
build_and_test:
name: Rust project
runs-on: ubuntu-latest
needs: check_for_changes
timeout-minutes: 20
services:
redis:
image: redis:6.0.12
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
with:
lfs: false
- uses: actions-rs/toolchain@v1.0.7
if: needs.check_for_changes.outputs.rust_changes == 'true'
with:
toolchain: 1.68.0
- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3
if: needs.check_for_changes.outputs.rust_changes == 'true'
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- name: Rust/Cargo cache
uses: actions/cache@v3
with:
key: rust-cache-v2-${{ hashFiles('src/rust/Cargo.lock') }}
# See: https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
- uses: actions-rs/install@v0.1.2
if: needs.check_for_changes.outputs.rust_changes == 'true'
with:
crate: cargo-trim
version: 0.8.0
- name: fmt check
if: needs.check_for_changes.outputs.rust_changes == 'true'
working-directory: src/rust
run: cargo fmt -- --check
- name: build
if: needs.check_for_changes.outputs.rust_changes == 'true'
working-directory: src/rust
run: cargo build --locked
- name: test
if: needs.check_for_changes.outputs.rust_changes == 'true'
working-directory: src/rust
run: cargo test --locked
- name: clippy
working-directory: src/rust
if: needs.check_for_changes.outputs.rust_changes == 'true'
run: cargo clippy --locked
- name: Cargo trim
if: needs.check_for_changes.outputs.rust_changes == 'true'
working-directory: src/rust
run: cargo trim --query