Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clang-format ci #524

Merged
merged 3 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: clang-format

on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 0 * * *'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Lint with clang-format
run: |
find -name '*.cpp' -o -name '*.h' -o -name '*.cu' -o -name '*.cuh' | xargs clang-format -i
GIT_DIFF=$(git diff)
if [[ -z $GIT_DIFF ]]; then
exit 0
fi
echo $GIT_DIFF
exit 1
19 changes: 19 additions & 0 deletions torchani/cuaev/delete-me.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// This file only exists temporarily for validating the clang-format CI
// This file should be deleted when https://github.com/aiqm/torchani/pull/516
// or https://github.com/aiqm/torchani/pull/521 is merged.

#include <stdio.h>
#include <stdlib.h>

__global__ void print_from_gpu(void) {
printf("Hello World! from thread [%d,%d] \
From device\n",
threadIdx.x, blockIdx.x);
}

int main(void) {
printf("Hello World from host!\n");
print_from_gpu<<<1, 1>>>();
cudaDeviceSynchronize();
return 0;
}