ci-unit-tests.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #
  2. # ci-unit-tests.yml
  3. # Build and execute unit tests to catch functional issues in code
  4. #
  5. name: CI - Unit Tests
  6. on:
  7. pull_request:
  8. branches:
  9. - bugfix-2.1.x
  10. # Cannot be enabled on 2.1.x until it contains the unit test framework
  11. #- 2.1.x
  12. paths-ignore:
  13. - config/**
  14. - data/**
  15. - docs/**
  16. - '**/*.md'
  17. push:
  18. branches:
  19. - bugfix-2.1.x
  20. # Cannot be enabled on 2.1.x until it contains the unit test framework
  21. #- 2.1.x
  22. paths-ignore:
  23. - config/**
  24. - data/**
  25. - docs/**
  26. - '**/*.md'
  27. jobs:
  28. # This runs all unit tests as a single job. While it should be possible to break this up into
  29. # multiple jobs, they currently run quickly and finish long before the compilation tests.
  30. run_unit_tests:
  31. name: Unit Test
  32. # These tests will only be able to run on the bugfix-2.1.x branch, until the next release
  33. # pulls them into additional branches.
  34. if: github.repository == 'MarlinFirmware/Marlin'
  35. runs-on: ubuntu-22.04
  36. steps:
  37. - name: Check out the PR
  38. uses: actions/checkout@v4
  39. - name: Cache pip
  40. uses: actions/cache@v4
  41. with:
  42. path: ~/.cache/pip
  43. key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
  44. restore-keys: |
  45. ${{ runner.os }}-pip-
  46. - name: Cache PlatformIO
  47. uses: actions/cache@v4
  48. with:
  49. path: ~/.platformio
  50. key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
  51. - name: Select Python 3.9
  52. uses: actions/setup-python@v5
  53. with:
  54. python-version: '3.9'
  55. architecture: 'x64'
  56. - name: Install PlatformIO
  57. run: |
  58. pip install -U platformio
  59. pio upgrade --dev
  60. pio pkg update --global
  61. - name: Run All Unit Tests
  62. run: |
  63. make unit-test-all-local