Skip to content

Commit

Permalink
Create static_tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnnsnk committed Dec 4, 2023
1 parent 588707e commit f46b4a7
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/static_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#
# detailed syntax defined in
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#
name: "Static Tests"

on: [push, pull_request]

jobs:
clang-format:
runs-on: "ubuntu-20.04"
env:
CLANG_REQUIRE_VERSION: 17.0.4
CLANG_FORMAT_FILE: ".clang-format"
steps:
- name: "Checkout repository content"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: "Install dependencies"
run: |
python -m pip install --force-reinstall clang-format==${{ env.CLANG_REQUIRE_VERSION }}
- name: "Run clang-format..."
run: |
files=$(find . -iname "*.h" -o -iname "*.cu" -o -iname "*.cpp")
diff -u <(cat ${files}) <(clang-format ${files})
black:
runs-on: "ubuntu-20.04"
steps:
- name: "Checkout repository content"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: "Run black..."
uses: psf/black@2a1c67e0b2f81df602ec1f6e7aeb030b9709dc7c # 23.11.0

flake8:
runs-on: "ubuntu-20.04"
steps:
- name: "Checkout repository content"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: "Set up Python 3.x"
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: 3.9

- name: "Install dependencies"
run: |
pip install flake8
- name: "Run flake8..."
run: |
flake8 .

0 comments on commit f46b4a7

Please sign in to comment.