Skip to content

Place player so npc_light_and_fine_detail_vision_mod can pass #1

Place player so npc_light_and_fine_detail_vision_mod can pass

Place player so npc_light_and_fine_detail_vision_mod can pass #1

Workflow file for this run

name: IWYU (include-what-you-use)
on:
push:
branches:
- master
pull_request:
branches:
- master
types: [opened, reopened, synchronize, ready_for_review]
# We only care about the latest revision of a PR, so cancel all previous instances.
concurrency:
group: iwyu-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
should_run: ${{ github.event_name == 'push' || steps.changed-files.outputs.result == 'true' }}
steps:
- name: check for relevant file changes
id: changed-files
if: ${{ github.event_name == 'pull_request' }}
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
script: |
const response = await github.paginate(github.rest.pulls.listFiles,
{
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
}
);
const dominated_by = [
/^src\//,
/^tests\//,
/^tools\/iwyu\//,
/CMakeLists\.txt$/,
/^\.github\/workflows\/iwyu\.yml$/,
];
const dominated = response.some(f => dominated_by.some(r => r.test(f.filename)));
return dominated;
iwyu:
needs: check-changes
if: ${{ needs.check-changes.outputs.should_run == 'true' }}
runs-on: ubuntu-24.04
env:
COMPILER: clang++-19
steps:
- name: install LLVM 19
run: |
sudo apt install llvm-19-dev clang-19 libclang-19-dev
sudo apt install cmake
- name: checkout IWYU repository
id: iwyu-checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
repository: include-what-you-use/include-what-you-use
path: include-what-you-use-src
ref: clang_19
persist-credentials: false
- name: checkout own repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
path: Cataclysm-DDA
persist-credentials: false
- name: cache IWYU build
id: iwyu-cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: iwyu-build
key: iwyu-clang19-ubuntu2404-${{ steps.iwyu-checkout.outputs.commit }}
- name: build IWYU
if: steps.iwyu-cache.outputs.cache-hit != 'true'
run: |
cmake -B iwyu-build -DCMAKE_PREFIX_PATH=/usr/lib/llvm-19 -DCMAKE_BUILD_TYPE=Release include-what-you-use-src
cmake --build iwyu-build --parallel 4
- name: set IWYU paths
id: build-iwyu
run: |
echo "IWYU_SRC_DIR=${PWD}/include-what-you-use-src">> "$GITHUB_OUTPUT"
echo "IWYU_BIN_DIR=${PWD}/iwyu-build/bin">> "$GITHUB_OUTPUT"
- name: determine changed files
if: ${{ github.event_name == 'pull_request' }}
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
script: |
var fs = require('fs');
const response = await github.paginate(github.rest.pulls.listFiles,
{
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
}
);
const files = response.map(x => x.filename);
for (const path of files) {
console.log(path);
}
fs.writeFileSync("Cataclysm-DDA/files_changed", files.join('\n') + '\n');
- name: create CDDA compilation database
working-directory: Cataclysm-DDA
run: |
set -x
echo ::group::Building compilation database
cmake -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_COMPILER=$COMPILER \
-DCMAKE_BUILD_TYPE="Release" \
-DTILES=${TILES:-0} \
-DSOUND=${SOUND:-0} \
-DLOCALIZE=${LOCALIZE:-0} \
.
echo ::endgroup::
# and include database too, for get_affected_files.py
make includes -j4 --silent TILES=${TILES:-0} SOUND=${SOUND:-0} LOCALIZE=${LOCALIZE:-0}
- uses: ammaraskar/gcc-problem-matcher@0f9c86f9e693db67dacf53986e1674de5f2e5f28 # master
- name: run IWYU
working-directory: Cataclysm-DDA
env:
IWYU_SRC_DIR: ${{ steps.build-iwyu.outputs.IWYU_SRC_DIR }}
IWYU_BIN_DIR: ${{ steps.build-iwyu.outputs.IWYU_BIN_DIR }}
run: |
PATH="${PATH}:${IWYU_BIN_DIR}:${IWYU_SRC_DIR}"
python build-scripts/ci-iwyu-run.py
iwyu-result:
if: ${{ always() }}
needs: [iwyu]
runs-on: ubuntu-latest
steps:
- name: require successful IWYU
run: |
result="${{ needs.iwyu.result }}"
if [ "$result" = "success" ] || [ "$result" = "skipped" ]; then
echo "IWYU result: $result"
exit 0
fi
echo "IWYU failed with result: $result"
exit 1