mirror of
https://github.com/pseXperiments/icicle.git
synced 2026-01-08 23:17:54 -05:00
48 lines
1.7 KiB
YAML
48 lines
1.7 KiB
YAML
name: Format
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- dev
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
formatting-rust:
|
|
name: Check Rust Code Formatting
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Check rustfmt
|
|
working-directory: ./wrappers/rust
|
|
# "-name tagret -prune" removes searching in any directory named "target"
|
|
# Formatting by single file is necessary due to generated files not being present
|
|
# before building the project.
|
|
# e.g. icicle-cuda-runtime/src/bindings.rs is generated and icicle-cuda-runtime/src/lib.rs includes that module
|
|
# causing rustfmt to fail.
|
|
run: if [[ $(find . -name target -prune -o -iname *.rs -print | xargs cargo fmt --check --) ]]; then echo "Please run cargo fmt"; exit 1; fi
|
|
# - name: Check clippy
|
|
# run: cargo clippy --no-deps --all-features --all-targets
|
|
|
|
formatting-golang:
|
|
name: Check Golang Code Formatting
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Check gofmt
|
|
run: if [[ $(go list ./... | xargs go fmt) ]]; then echo "Please run go fmt"; exit 1; fi
|
|
|
|
formatting-cpp-cuda:
|
|
name: Check C++/CUDA Code Formatting
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Check clang-format
|
|
run: if [[ $(find ./ \( -path ./icicle/build -prune -o -path ./**/target -prune -o -path ./examples -prune \) -iname *.h -or -iname *.cuh -or -iname *.cu -or -iname *.c -or -iname *.cpp | xargs clang-format --dry-run -ferror-limit=1 -style=file 2>&1) ]]; then echo "Please run clang-format"; exit 1; fi
|