commitflow-py3.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. name: Python 3 CI
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. branches:
  8. - master
  9. jobs:
  10. hue-build-and-tests:
  11. runs-on: ubuntu-latest
  12. strategy:
  13. matrix:
  14. python-version: ['3.8', '3.9', '3.10', '3.11']
  15. steps:
  16. - name: Checkout
  17. uses: actions/checkout@v4
  18. with:
  19. fetch-depth: 0
  20. - name: Check commit title format
  21. run: |
  22. ./tools/ci/check_for_commit_message.sh
  23. - name: Set up Python ${{ matrix.python-version }}
  24. uses: actions/setup-python@v5
  25. with:
  26. python-version: ${{ matrix.python-version }}
  27. - name: Cache pip
  28. uses: actions/cache@v4
  29. with:
  30. # This path is specific to Ubuntu
  31. path: ~/.cache/pip
  32. key: ${{ runner.os }}-pip-${{ hashFiles('desktop/core/generate_requirements.py') }}
  33. restore-keys: |
  34. ${{ runner.os }}-pip-
  35. ${{ runner.os }}-
  36. - name: Setup node 20 and cache npm
  37. uses: actions/setup-node@v4
  38. with:
  39. node-version: 20
  40. cache: 'npm'
  41. - name: Build Hue
  42. run: |
  43. sudo apt-get update
  44. sudo apt-get install -y build-essential asciidoc libkrb5-dev libldap2-dev libsasl2-dev libxslt-dev libsasl2-modules-gssapi-mit libsnappy-dev libgdbm-dev
  45. export PYTHON_VER=python${{ matrix.python-version }}
  46. export SKIP_PYTHONDEV_CHECK=true
  47. export ROOT=$PWD
  48. make apps test_prep
  49. - name: Run unit tests
  50. run: |
  51. if [[ "${{ matrix.python-version }}" == "3.11" ]]; then
  52. ./build/env/bin/pytest
  53. else
  54. ./build/venvs/python${{ matrix.python-version }}/bin/pytest
  55. fi
  56. - name: Run python lint check
  57. run: |
  58. if [[ "${{ matrix.python-version }}" == "3.11" ]]; then
  59. PYTHONWARNINGS=always ./build/env/bin/hue runruff check
  60. else
  61. PYTHONWARNINGS=always ./build/venvs/python${{ matrix.python-version }}/bin/hue runruff check
  62. fi
  63. - name: Upload reports
  64. if: matrix.python-version == '3.11'
  65. uses: actions/upload-artifact@v4
  66. with:
  67. name: hue-reports
  68. path: ./reports