Rust: add CI

This commit is contained in:
Paolo Tranquilli
2024-09-09 10:59:10 +02:00
parent d8f37cf1f9
commit 4512e4280d

52
.github/workflows/rust.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: "Rust"
on:
pull_request:
paths:
- "rust/**"
- "misc/bazel/**"
- "misc/codegen/**"
- "shared/**"
- "MODULE.bazel"
- .github/workflows/rust.yml
- .github/actions/**
- codeql-workspace.yml
- "!**/*.md"
- "!**/*.qhelp"
branches:
- rust-experiment
- main
- rc/*
- codeql-cli-*
permissions:
contents: read
jobs:
cargo-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compilation
working-directory: rust/extractor
shell: bash
run: cargo check
- name: Clippy
working-directory: rust/extractor
shell: bash
run: |
cargo clippy --fix
git diff --exit-code
- name: Format
working-directory: rust/extractor
shell: bash
run: |
cargo fmt --check
- name: Code generation
working-directory: rust/extractor
shell: bash
run: |
bazel run codegen
git add .
git diff --exit-code HEAD