The v2 action depends on deprecated Node.js 12, as indicated by warning
from GitHub Actions:
Node.js 12 actions are deprecated. For more information see: [1].
Please update the following actions to use Node.js 16:
actions/checkout@v2
(See [2] for an example.)
Upgrade to actions/checkout@v3 to silence the warning.
Unfortunately this new version has a very confusing policy for default
checkout ref: "[...] the last merge commit of the pull request merge
branch". There does not appear to be a convenient way to fall back to
the v2 behavior.
Add some conditional logic to resolve the HEAD of the right branch
whether it's a schedule, push or pull_request event.
[1] https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
[2] https://github.com/include-what-you-use/include-what-you-use/actions/runs/3718310359
Installation of libclang-16-dev would fail with:
Unpacking libclang-16-dev (1:16~++20221216031545+6c5f3f62bdb2-1~exp1~20221216151636.624) ...
dpkg: error processing archive /var/cache/apt/archives/libclang-16-dev_1%3a16~++20221216031545+6c5f3f62bdb2-1~exp1~20221216151636.624_amd64.deb (--unpack):
trying to overwrite '/usr/lib/x86_64-linux-gnu/libclang-16.so.1', which is also in package libclang1-16 1:16~++20221216031545+6c5f3f62bdb2-1~exp1~20221216151636.624
...
Unpacking libclang-dev (1:16.0-57~exp1~20221014130100.5) ...
Errors were encountered while processing:
/var/cache/apt/archives/libclang-16-dev_1%3a16~++20221216031545+6c5f3f62bdb2-1~exp1~20221216151636.624_amd64.deb
...
E: Sub-process /usr/bin/dpkg returned an error code (1)
Error: Process completed with exit code 100.
libclang-16-dev somehow depends on libclang1-16, and both are trying to
install the same libclang1.so.
Use --force-override switch to comfort dpkg, even though it's not
recommended in practice. See e.g. https://askubuntu.com/a/491086/852068.
Let's remove this as soon as possible.
The libclang-dev packages are actually called libclang-NN-dev, not
libclang-dev-NN, so make the glob a little more permissive to remove
more preinstalled packages.
In the previous commit, I merged overlooking the fact that it didn't work.
Apparently push and pull_request can be combined with schedule if they're all
dict forms; the former two can have empty values.
This will make it easier for us to detect when IWYU breaks due to upstream Clang
changes.
The default behavior for 'schedule' is to run the build for the default branch,
so it only applies to our master branch.
libclang-NN.so recently changed versioning schemes, and it doesn't look like the
Debian packages have caught up.
We don't use this file, so placate CMake by creating an empty placeholder.
Leaving this blank will use LLVM/Clang snapshot packages.
When a branch is taken for a released version, it can be updated to
"-NN" where NN is the major version for the branch CI to target.
Travis has been unreliable lately; have not been able to find a way to
fix the integration with GitHub to get CI notifications for pull
requests.
To minimize the number of moving parts, move CI to GitHub workflows
instead.
Variables were more convoluted in GitHub's workflow spec, so use a
different approach to detecting the latest installed LLVM version:
uninstall all LLVM and Clang packages first, and then install the one we
want to target. That makes it possible to lean on defaults much more and
reduces noise.
Remove travis config.