Add device type shorthand for Tape, default generic INQUIRE string #2411
Workflow file for this run
This file contains hidden or 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++ Tests; Full Static Analysis | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - 'cpp/**' | |
| - 'python/**' | |
| - '.github/workflows/cpp.yml' | |
| branches: | |
| - 'develop' | |
| - 'main' | |
| pull_request: | |
| paths: | |
| - 'cpp/**' | |
| - 'python/**' | |
| - '.github/workflows/cpp.yml' | |
| types: | |
| - opened | |
| - synchronize | |
| branches: | |
| - 'develop' | |
| - 'main' | |
| env: | |
| APT_PACKAGES: libspdlog-dev libpcap-dev libevdev2 libev-dev protobuf-compiler libgtest-dev libgmock-dev | |
| jobs: | |
| unit_tests: | |
| runs-on: ubuntu-24.04 | |
| defaults: | |
| run: | |
| working-directory: cpp | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Install dependencies | |
| run: sudo apt-get install ${{ env.APT_PACKAGES }} | |
| - name: Build unit tests | |
| run: DEBUG=1 make -j $(nproc) test | |
| - name: Run unit tests | |
| run: (set -o pipefail && bin/piscsi_test | tee piscsi_test_log.txt) | |
| - name: Upload logs | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: piscsi_test_log.txt | |
| path: cpp/piscsi_test_log.txt | |
| sonarcloud: | |
| runs-on: ubuntu-24.04 | |
| if: > | |
| (github.event_name == 'push' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot') || (github.event_name | |
| == 'pull_request' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' && github.actor | |
| != 'dependabot') | |
| env: | |
| BUILD_WRAPPER_OUT_DIR: "$HOME/.build_wrapper_out" | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install dependencies | |
| run: sudo apt-get install ${{ env.APT_PACKAGES }} | |
| - name: Install Build Wrapper | |
| uses: SonarSource/sonarqube-scan-action/install-build-wrapper@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602 # v6.0.0 | |
| - name: Generate coverage | |
| run: >- | |
| (mkdir -p ${{ env.BUILD_WRAPPER_OUT_DIR }} || true) && | |
| build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make -j $(nproc) -C cpp coverage | |
| - name: Run gcov | |
| working-directory: cpp | |
| run: gcov --preserve-paths $(find -name '*.gcno') | |
| - name: Run sonar-scanner | |
| uses: sonarsource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602 # v6.0.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| with: | |
| args: | | |
| --define sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json | |
| --define sonar.projectKey=akuker-PISCSI | |
| --define sonar.organization=piscsi | |
| --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" | |
| --define sonar.cfamily.gcov.reportsPath=. | |
| --define sonar.coverage.exclusions="cpp/**/test/**" | |
| --define sonar.cpd.exclusions="cpp/**/test/**" | |
| --define sonar.inclusions="cpp/**,python/**" | |
| --define sonar.python.version=3.9,3.11 |