ci.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. # badge: https://github.com/borgbackup/borg/workflows/CI/badge.svg?branch=master
  2. name: CI
  3. on:
  4. push:
  5. branches: [ 1.2-maint ]
  6. paths:
  7. - '**.py'
  8. - '**.pyx'
  9. - '**.c'
  10. - '**.h'
  11. - '**.yml'
  12. - '**.toml'
  13. - '**.cfg'
  14. - '**.ini'
  15. - 'requirements.d/*'
  16. - '!docs/**'
  17. pull_request:
  18. branches: [ 1.2-maint ]
  19. paths:
  20. - '**.py'
  21. - '**.pyx'
  22. - '**.c'
  23. - '**.h'
  24. - '**.yml'
  25. - '**.toml'
  26. - '**.cfg'
  27. - '**.ini'
  28. - 'requirements.d/*'
  29. - '!docs/**'
  30. jobs:
  31. lint:
  32. runs-on: ubuntu-22.04
  33. timeout-minutes: 5
  34. steps:
  35. - uses: actions/checkout@v4
  36. - name: Set up Python
  37. uses: actions/setup-python@v5
  38. with:
  39. python-version: 3.11
  40. - name: Lint with flake8
  41. run: |
  42. pip install flake8
  43. flake8 src scripts conftest.py
  44. pytest:
  45. needs: lint
  46. strategy:
  47. fail-fast: false
  48. matrix:
  49. include:
  50. - os: ubuntu-22.04
  51. python-version: '3.8'
  52. toxenv: py38-fuse2
  53. - os: ubuntu-22.04
  54. python-version: '3.9'
  55. toxenv: py39-fuse3
  56. - os: ubuntu-22.04
  57. python-version: '3.10'
  58. toxenv: py310-fuse3
  59. - os: ubuntu-22.04
  60. python-version: '3.11'
  61. toxenv: py311-fuse2
  62. - os: ubuntu-24.04
  63. python-version: '3.12'
  64. toxenv: py312-fuse3
  65. - os: macos-14
  66. python-version: '3.11'
  67. toxenv: py311-none # note: no fuse testing, due to #6099, see also #6196.
  68. env:
  69. # Configure pkg-config to use OpenSSL from Homebrew
  70. PKG_CONFIG_PATH: "/opt/homebrew/opt/openssl@3.0/lib/pkgconfig:$PKG_CONFIG_PATH"
  71. TOXENV: ${{ matrix.toxenv }}
  72. runs-on: ${{ matrix.os }}
  73. timeout-minutes: 180
  74. steps:
  75. - uses: actions/checkout@v4
  76. with:
  77. # just fetching 1 commit is not enough for setuptools-scm, so we fetch all
  78. fetch-depth: 0
  79. - name: Set up Python ${{ matrix.python-version }}
  80. uses: actions/setup-python@v5
  81. with:
  82. python-version: ${{ matrix.python-version }}
  83. - name: Cache pip
  84. uses: actions/cache@v4
  85. with:
  86. path: ~/.cache/pip
  87. key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
  88. restore-keys: |
  89. ${{ runner.os }}-pip-
  90. ${{ runner.os }}-
  91. - name: Install Linux packages
  92. if: ${{ runner.os == 'Linux' }}
  93. run: |
  94. sudo apt-get update
  95. sudo apt-get install -y libssl-dev libacl1-dev liblz4-dev libzstd-dev pkg-config build-essential
  96. sudo apt-get install -y libxxhash-dev || true
  97. sudo apt-get install -y libfuse-dev fuse || true # Required for Python llfuse module
  98. sudo apt-get install -y libfuse3-dev fuse3 || true # Required for Python pyfuse3 module
  99. - name: Install macOS packages
  100. if: ${{ runner.os == 'macOS' }}
  101. run: |
  102. brew install pkg-config || brew upgrade pkg-config
  103. brew install zstd || brew upgrade zstd
  104. brew install lz4 || brew upgrade lz4
  105. brew install xxhash || brew upgrade xxhash
  106. brew install openssl@3.0 || brew upgrade openssl@3.0
  107. - name: Install Python requirements
  108. run: |
  109. python -m pip install --upgrade pip setuptools wheel
  110. pip install -r requirements.d/development.txt
  111. - name: Install borgbackup
  112. env:
  113. # we already have that in the global env, but something is broken and overwrites that.
  114. # so, set it here, again.
  115. PKG_CONFIG_PATH: "/opt/homebrew/opt/openssl@3.0/lib/pkgconfig:$PKG_CONFIG_PATH"
  116. run: |
  117. # pip install -e .
  118. python setup.py -v develop
  119. - name: run pytest via tox
  120. env:
  121. # we already have that in the global env, but something is broken and overwrites that.
  122. # so, set it here, again.
  123. PKG_CONFIG_PATH: "/opt/homebrew/opt/openssl@3.0/lib/pkgconfig:$PKG_CONFIG_PATH"
  124. run: |
  125. # do not use fakeroot, but run as root. avoids the dreaded EISDIR sporadic failures. see #2482.
  126. #sudo -E bash -c "tox -e py"
  127. tox --skip-missing-interpreters
  128. - name: Upload coverage to Codecov
  129. uses: codecov/codecov-action@v4
  130. env:
  131. OS: ${{ runner.os }}
  132. python: ${{ matrix.python-version }}
  133. with:
  134. token: ${{ secrets.CODECOV_TOKEN }}
  135. env_vars: OS, python