Add a workflow to upload python module to pypi #141
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: cpp-linter | |
on: | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
cpp-linter: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Flags | |
run: export USE_CUDA=0 | |
- name: Install Protobuf | |
run: sudo apt install protobuf-compiler | |
- name: Install Python dependencies | |
uses: py-actions/py-dependency-install@v4 | |
with: | |
path: "PyTorch_requirements.txt" | |
- name: Configure CMake | |
# Configure CMake so we can get a compile_commands.json so that clang-tidy won't be angry about missing headers any more | |
run: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DNT_ENABLE_BENCHMARKING=ON -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'` -B ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
## horrible little hack to put spdlog include files somewhere that clang-tidy can find them | |
## it doesn't seem to like headers included by cpm | |
- name: Move spdlog | |
run: | | |
cp -r _deps/spdlog-src/include/spdlog . | |
cp spdlog/spdlog* . | |
- uses: cpp-linter/cpp-linter-action@main | |
id: linter | |
continue-on-error: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
style: "Microsoft" | |
ignore: '.github|_deps|CMakeFiles|spdlog*' | |
tidy-review: true | |
step-summary: true | |
files-changed-only: true | |
thread-comments: false | |
file-annotations: false | |
tidy-checks: 'boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*,-modernize-use-trailing-return-type,-modernize-use-emplace,-readability-redundant-access-specifiers' | |
- name: Fail fast?! | |
if: steps.linter.outputs.checks-failed != 0 | |
#run: | | |
# echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}" | |
# for actual deployment | |
run: exit 1 |