tests.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: Unit tests
  2. on:
  3. workflow_dispatch:
  4. push:
  5. paths:
  6. - '.github/workflows/tests.yml'
  7. - 'src/**'
  8. - 'CMakeModules/**'
  9. - CMakeLists.txt
  10. - 'protocols/**'
  11. branches: [main]
  12. pull_request:
  13. paths:
  14. - '.github/workflows/tests.yml'
  15. - 'src/**'
  16. - 'CMakeModules/**'
  17. - CMakeLists.txt
  18. - 'protocols/**'
  19. branches: [main]
  20. env:
  21. # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
  22. BUILD_TYPE: Release
  23. jobs:
  24. testing:
  25. strategy:
  26. matrix:
  27. os: [ubuntu-24.04]
  28. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  29. # You can convert this to a matrix build if you need cross-platform coverage.
  30. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  31. runs-on: ${{ matrix.os }}
  32. steps:
  33. - uses: actions/checkout@v3
  34. with:
  35. submodules: true
  36. # cache some build information
  37. - name: ccache
  38. uses: hendrikmuhs/ccache-action@v1.2
  39. with:
  40. key: ${{ github.job }}-${{ matrix.os }} # Eg. "some_build-ubuntu-latest"
  41. - name: Install dependencies
  42. if: matrix.os == 'ubuntu-24.04'
  43. run: sudo apt-get update && sudo apt-get -y install libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv2 libfftw3-dev
  44. - name: Configure CMake
  45. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  46. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  47. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTING=1
  48. - name: Build
  49. # Build your program with the given configuration
  50. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
  51. - name: Run tests
  52. # Run the unit tests available
  53. run: ${{github.workspace}}/build/output/tests