commitflow-py3.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. name: Python 3 CI
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. branches:
  8. - master
  9. jobs:
  10. build:
  11. runs-on: ubuntu-20.04
  12. strategy:
  13. matrix:
  14. python-version: [3.8, 3.9]
  15. steps:
  16. - name: Checkout
  17. uses: actions/checkout@v4
  18. with:
  19. fetch-depth: 0
  20. - name: run commit title format check
  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/requirements.txt') }}
  33. restore-keys: |
  34. ${{ runner.os }}-pip-
  35. ${{ runner.os }}-
  36. - name: compile
  37. run: |
  38. sudo apt-get update
  39. sudo apt-get install -y gcc g++ build-essential python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils asciidoc rsync curl sudo libkrb5-dev libldap2-dev libsasl2-dev libxml2-dev libxslt-dev libsasl2-modules-gssapi-mit libsnappy-dev libffi-dev # This should not be needed as some point
  40. sudo curl -sL https://deb.nodesource.com/setup_14.x | sudo bash - && sudo apt-get install -y nodejs
  41. sudo curl -sL https://bootstrap.pypa.io/get-pip.py | sudo python${{ matrix.python-version }}
  42. sudo apt-get install -y python3-setuptools
  43. sudo apt-get install -y libncursesw5-dev libgdbm-dev libc6-dev libssl-dev openssl
  44. export PYTHON_VER=python${{ matrix.python-version }}
  45. export ROOT=$PWD
  46. make apps
  47. - name: run tests
  48. run: |
  49. PYTHONWARNINGS=always ./build/env/bin/pytest
  50. - name: run python lints
  51. run: |
  52. ./build/env/bin/pip install pylint==2.5.3 pylint-django==2.3.0 configparser==5.3.0
  53. ./tools/ci/check_for_python_lint.sh
  54. - name: run documentation lints
  55. run: |
  56. # Installs to move to image building
  57. curl -O https://dl.google.com/go/go1.17.linux-amd64.tar.gz
  58. tar -xvf go1.17.linux-amd64.tar.gz
  59. export GO111MODULE=on
  60. go/bin/go get -u github.com/raviqqe/muffet@v1.5.7
  61. curl --output hugo_0.69.0_Linux.tar.gz -L https://github.com/gohugoio/hugo/releases/download/v0.69.0/hugo_0.69.0_Linux-64bit.tar.gz
  62. tar -xvf hugo_0.69.0_Linux.tar.gz
  63. export PATH=$PWD:$HOME/go/bin:$PATH
  64. # Trigger linting if documentation changes
  65. ./tools/ci/check_for_website_dead_links.sh docs/docs-site
  66. # ./tools/ci/check_for_website_dead_links.sh docs/gethue