-
Notifications
You must be signed in to change notification settings - Fork 456
Add CMake build and CI workflow #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There are still warnings in lodepng_unittest.cpp which are being suppressed by a compile option. They should be fixed. See comment in CMakeLists.txt.
Includes * documentation in README.md * vcpkg.json letting vcpkg automatically download, build and install sdl2 for the benchmark and showpng utilities. * .gitignore to ignore artifacts of both the CMake and Makefile builds. sdl2 can also be installed with the platform's package manager. Includes .gitignore to ignore artifacts of the build.
so it can be run without knowledge of the executable location within the build directory.
|
The CI workflow uses a hack for caching the built vcpkg package (sdl2) to speed up subsequent CI runs. I am not sure how robust it is to recognizing package or platform updates or changes. I have created an alternative using the caching technique recommended by vcpkg which will be robust. However this requires a GitHub Personal Access Token to work. It is needed for accessing the GitHub API for reading and writing packages to NuGet (the caching service). It is easy to create such a PAT and add it to the Actions secrets. @lvandeve Let me know if you are okay with this. If so, I will update this PR. |
Convert to use pre-installed vcpkg on macOS.
|
I just pushed a change to use the NuGet caching recommended by vcpkg. This is fully robust. Since vcpkg handles the caching it always knows what packages have changed and need to uploaded to the cache again. The commit includes a change to use the pre-installed vcpkg on macOS. I have used the username |
Removes the need for a special PAT.
|
Commit ccef5eb removes the need to make a GitHub Personal Access Token for access to GitHub packages for the vcpkg cache. It uses I used a custom token before because the vcpkg documentation said you could not use |
|
To use this you will need to enable Actions for this repo in Settings->Actions. I think I will then need to push some innocuous (non) change to this PR to trigger a run of the workflow. I wrote earlier that you may have to add the workflow file to |
The fastest way for me to debug the reported unittest failures in my PR #206 was to create a CMake build to generate an Xcode project. Here it is together with a CI workflow that builds the utilities and
unitteston macOS, Ubuntu and Windows and runsunittest. This CI will reveal issues in any future PRs.Note that you may have to add a file
.github/workflows/build_and_test.ymlto master in order to be able to run the CI in this PR. GH Actions ignores workflow files in branches that don't have an equivalent in master. Whether this applies to PRs I do not know.This CI will run when a tag of the form
vX.Y.Zis added, when a commit is pushed to master and on PRs (subject to the above caveat.) It can also be run manually.The PR includes fixes for many compile warnings, mostly about loss of data from 64-bit to 32-bit conversions. None of these are in
lodepng.{cpp,h}. MSVC reports many more including manyinttocharconversions that should be looked at. Many of these are inlodepng.{cpp,h}.See https://github.com/KhronosGroup/lodepng/actions/runs/15513735532 for an example CI run. See the log for the Windows job for all the MSVC warnings I wrote about.