The problem

It has been a while bindgen did not work in the github workflow for my github project.

   --- stderr
  Not building on Android.
  Not building on Android.
  MSVC can handle C99, compiling code as C
  BASE_C_FLAGS= -nologo -MD -Brepro /W3 /c
  BASE_CXX_FLAGS= -nologo -MD -Brepro /W3
  CMake Warning:
    Manually-specified variables were not used by the project:


  cmake build out dir: "D:\\a\\plctag-rs\\plctag-rs\\target\\debug\\build\\plctag-sys-a3fc1b7311116163\\out"
  thread 'main' panicked at 'Unable to find libclang: "the `libclang` shared library at C:\\msys64\\mingw64\\bin\\libclang.dll could not be opened: LoadLibraryExW failed"', C:\Users\runneradmin\.cargo\registry\src\\bindgen-0.59.1\src/
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Wasted hours to resolve it. Finally, found that the solution is that you have to install LLVM yourself.

- name: Cache LLVM and Clang
  id: cache-llvm
  uses: actions/cache@v2
    path: ${{ runner.temp }}/llvm
    key: llvm-11.0
  if: matrix.os == 'windows-latest'
- name: Install LLVM and Clang
  uses: KyleMayes/install-llvm-action@v1
    version: "11.0"
    directory: ${{ runner.temp }}/llvm
    cached: ${{ steps.cache-llvm.outputs.cache-hit }}
  if: matrix.os == 'windows-latest'

Hope this saves you some time.