Supply the CMake options or other steps for your plugins in unit-tests.yml.
Read the GoogleTest User’s Guide and write the tests.
Enable ClangFormat.
- headers - third party headers for the plugins
- mocks - mocks for the tests
- source - other sources for the tests
- tests - the tests
Install act and docker.
curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
sudo apt remove docker docker-engine docker.io
sudo apt update
sudo apt -y install docker.io
sudo snap install docker
brew install act
brew install --cask docker
Create a personal access token.
Invoke the workflow.
act -W .github/workflows/unit-tests.yml -s GITHUB_TOKEN=[token]
-r, --reuse
to reuse the container.
Get a bash shell in the container.
docker ps
docker exec -it <container name> /bin/bash
-I dir
adds the dir to the list of directories to be searched for headers.
-Wl,-wrap,symbol
uses a wrapper function for symbol.
-DCMAKE_DISABLE_FIND_PACKAGE_<PackageName>=ON
disables non-REQUIRED find_package
call.
At the bottom of the workflow summary page on GitHub, there is a section with artifacts. unit-tests.yml uploads: coverage, valgrind_log.