integration.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. ---
  2. name: Integration
  3. # yamllint disable-line rule:truthy
  4. on:
  5. push:
  6. branches:
  7. - master
  8. pull_request:
  9. branches:
  10. - master
  11. concurrency:
  12. group: ${{ github.workflow }}-${{ github.ref_name }}
  13. cancel-in-progress: false
  14. permissions:
  15. contents: read
  16. env:
  17. PYTHON_VERSION: "3.13"
  18. jobs:
  19. test:
  20. name: Python ${{ matrix.python-version }}
  21. runs-on: ubuntu-24.04
  22. strategy:
  23. matrix:
  24. python-version:
  25. - "3.9"
  26. - "3.10"
  27. - "3.11"
  28. - "3.12"
  29. - "3.13"
  30. steps:
  31. - name: Setup Python
  32. uses: actions/setup-python@v5
  33. with:
  34. python-version: "${{ matrix.python-version }}"
  35. - name: Checkout
  36. uses: actions/checkout@v4
  37. with:
  38. persist-credentials: "false"
  39. - name: Setup cache Python
  40. uses: actions/cache@v4
  41. with:
  42. key: "python-${{ matrix.python-version }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
  43. restore-keys: "python-${{ matrix.python-version }}-${{ runner.arch }}-"
  44. path: "./local/"
  45. - name: Setup venv
  46. run: make V=1 install
  47. - name: Run tests
  48. run: make V=1 ci.test
  49. theme:
  50. name: Theme
  51. runs-on: ubuntu-24.04-arm
  52. steps:
  53. - name: Setup Python
  54. uses: actions/setup-python@v5
  55. with:
  56. python-version: "${{ env.PYTHON_VERSION }}"
  57. - name: Checkout
  58. uses: actions/checkout@v4
  59. with:
  60. persist-credentials: "false"
  61. - name: Setup Node.js
  62. uses: actions/setup-node@v4
  63. with:
  64. node-version-file: "./.nvmrc"
  65. - name: Setup cache Node.js
  66. uses: actions/cache@v4
  67. with:
  68. key: "nodejs-${{ runner.arch }}-${{ hashFiles('./.nvmrc', './package.json') }}"
  69. path: "./client/simple/node_modules/"
  70. - name: Setup cache Python
  71. uses: actions/cache@v4
  72. with:
  73. key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
  74. restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
  75. path: "./local/"
  76. - name: Setup venv
  77. run: make V=1 install
  78. - name: Build
  79. run: make themes.all
  80. dockers:
  81. name: Docker
  82. if: github.ref == 'refs/heads/master'
  83. needs:
  84. - test
  85. - theme
  86. env:
  87. DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
  88. runs-on: ubuntu-24.04
  89. steps:
  90. - name: Checkout
  91. if: env.DOCKERHUB_USERNAME != null
  92. uses: actions/checkout@v4
  93. with:
  94. # make sure "make docker.push" can get the git history
  95. fetch-depth: '0'
  96. - name: Set up Python
  97. uses: actions/setup-python@v5
  98. with:
  99. python-version: '3.12'
  100. architecture: 'x64'
  101. - name: Cache Python dependencies
  102. id: cache-python
  103. uses: actions/cache@v4
  104. with:
  105. path: |
  106. ./local
  107. ./.nvm
  108. ./node_modules
  109. key: python-ubuntu-20.04-3.12-${{ hashFiles('requirements*.txt', 'setup.py','.nvmrc', 'package.json') }}
  110. - name: Set up QEMU
  111. if: env.DOCKERHUB_USERNAME != null
  112. uses: docker/setup-qemu-action@v1
  113. - name: Set up Docker Buildx
  114. if: env.DOCKERHUB_USERNAME != null
  115. uses: docker/setup-buildx-action@v1
  116. - name: Login to DockerHub
  117. if: env.DOCKERHUB_USERNAME != null
  118. uses: docker/login-action@v1
  119. with:
  120. username: ${{ secrets.DOCKERHUB_USERNAME }}
  121. password: ${{ secrets.DOCKERHUB_TOKEN }}
  122. - name: Build and push
  123. if: env.DOCKERHUB_USERNAME != null
  124. run: make -e GIT_URL=$(git remote get-url origin) docker.buildx