Fix spdx workflow (#12) #23
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: C++ Linter | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
cpp-linter: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Model | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Cache Dependencies | |
id: cache-depends | |
uses: actions/cache@v2 | |
with: | |
path: protobuf-21.12 | |
key: ${{ runner.os }}-v1-depends | |
- name: Download ProtoBuf | |
if: steps.cache-depends.outputs.cache-hit != 'true' | |
run: curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protobuf-all-21.12.tar.gz && tar xzvf protobuf-all-21.12.tar.gz | |
- name: Build ProtoBuf | |
if: steps.cache-depends.outputs.cache-hit != 'true' | |
working-directory: protobuf-21.12 | |
run: ./configure DIST_LANG=cpp --prefix=/usr && make | |
- name: Install ProtoBuf | |
working-directory: protobuf-21.12 | |
run: sudo make install && sudo ldconfig | |
- name: Prepare C++ Build | |
run: mkdir build | |
- name: Configure CMake | |
working-directory: build | |
run: cmake -DCMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install -DCMAKE_EXPORT_COMPILE_COMMANDS=on .. | |
- name: Build C++ | |
working-directory: build | |
run: cmake --build . | |
- name: Lint CPP | |
uses: cpp-linter/cpp-linter-action@v2 | |
id: linter | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
style: file | |
tidy-checks: '' | |
version: '14' | |
files-changed-only: true | |
thread-comments: true | |
database: 'build/' | |
ignore: 'build | protobuf-21.12 | .github' | |
extra-args: '-I ./build/lib/open-simulation-interface' | |
- name: Fail fast?! | |
if: steps.linter.outputs.checks-failed > 0 | |
run: echo "Some files failed the linting checks!" | |
# for actual deployment | |
# run: exit 1 |