ccpp.yml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. name: C/C++ CI
  2. on:
  3. push:
  4. branches: [ master, release/v8.* ]
  5. pull_request:
  6. branches: [ master, release/v8.* ]
  7. jobs:
  8. build:
  9. if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
  10. runs-on: ubuntu-latest
  11. strategy:
  12. matrix:
  13. # A valid option parameter to the cmake file.
  14. # See BUILD_OPTIONS in tests/CMakeLists.txt.
  15. build_option: ['OPTIONS_MINIMAL_MONOCHROME',
  16. 'OPTIONS_NORMAL_8BIT',
  17. 'OPTIONS_16BIT',
  18. 'OPTIONS_16BIT_SWAP',
  19. 'OPTIONS_FULL_32BIT']
  20. name: Build ${{ matrix.build_option }}
  21. steps:
  22. - uses: actions/checkout@v2
  23. - uses: ammaraskar/gcc-problem-matcher@master
  24. - name: Install prerequisites
  25. run: scripts/install-prerequisites.sh
  26. - name: Building ${{ matrix.build_option }}
  27. run: python tests/main.py --build-option=${{ matrix.build_option }} build
  28. test-native:
  29. runs-on: ubuntu-latest
  30. name: amd64 Executable Tests
  31. steps:
  32. - uses: actions/checkout@v2
  33. - uses: ammaraskar/gcc-problem-matcher@master
  34. - name: Install prerequisites
  35. run: scripts/install-prerequisites.sh
  36. - name: Run tests
  37. run: python tests/main.py --report test
  38. - name: Upload coverage to Codecov
  39. uses: codecov/codecov-action@v2
  40. if: github.event_name == 'push'
  41. with:
  42. fail_ci_if_error: true
  43. verbose: true
  44. test-cross:
  45. # The host should always be linux
  46. runs-on: ubuntu-latest
  47. name: ${{ matrix.arch }} Executable Tests
  48. # Run steps on a matrix of 3 arch/distro combinations
  49. strategy:
  50. matrix:
  51. arch: [ 'aarch64', 'armv6', 'armv7' ]
  52. steps:
  53. - uses: actions/checkout@v2.1.0
  54. - uses: ammaraskar/gcc-problem-matcher@master
  55. - name: Setup cache
  56. uses: actions/cache@v2
  57. with:
  58. path: |
  59. ~/.ccache
  60. key: lvgl_ci_cross_test_ccache_${{ matrix.arch }}_${{ github.sha }}
  61. restore-keys: |
  62. lvgl_ci_cross_test_ccache_${{ matrix.arch }}
  63. - uses: uraimo/run-on-arch-action@v2.1.1
  64. name: Run tests
  65. id: build
  66. with:
  67. arch: ${{ matrix.arch }}
  68. distro: bullseye
  69. # Not required, but speeds up builds
  70. githubToken: ${{ github.token }}
  71. # The shell to run commands with in the container
  72. shell: /bin/bash
  73. # Create cached/volume directories on host
  74. setup: |
  75. mkdir -p ~/.ccache
  76. # Mount cached directories in the container for faster builds
  77. dockerRunArgs: |
  78. --volume "${HOME}/.ccache:/root/.ccache"
  79. install: |
  80. apt-get update -y
  81. apt-get install build-essential ccache python3 libpng-dev ruby-full gcovr cmake -q -y
  82. /usr/sbin/update-ccache-symlinks
  83. echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc
  84. run: |
  85. env PATH="/usr/lib/ccache:$PATH" ASAN_OPTIONS=detect_leaks=0 python3 tests/main.py test