ci.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # badge: https://github.com/borgbackup/borg/workflows/CI/badge.svg?branch=master
  2. name: CI
  3. on:
  4. push:
  5. branches: [ 1.4-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.4-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. - uses: chartboost/ruff-action@v1
  37. pytest:
  38. needs: lint
  39. strategy:
  40. fail-fast: false
  41. matrix:
  42. include:
  43. - os: ubuntu-22.04
  44. python-version: '3.9'
  45. toxenv: py39-fuse2
  46. - os: ubuntu-22.04
  47. python-version: '3.10'
  48. toxenv: py310-fuse3
  49. - os: ubuntu-22.04
  50. python-version: '3.11'
  51. toxenv: py311-fuse2
  52. - os: ubuntu-24.04
  53. python-version: '3.12'
  54. toxenv: py312-fuse3
  55. - os: ubuntu-24.04
  56. python-version: '3.13'
  57. toxenv: py313-fuse3
  58. - os: macos-14
  59. python-version: '3.11'
  60. toxenv: py311-none # note: no fuse testing, due to #6099, see also #6196.
  61. env:
  62. # Configure pkg-config to use OpenSSL from Homebrew
  63. PKG_CONFIG_PATH: "/opt/homebrew/opt/openssl@3.0/lib/pkgconfig:$PKG_CONFIG_PATH"
  64. TOXENV: ${{ matrix.toxenv }}
  65. runs-on: ${{ matrix.os }}
  66. timeout-minutes: 180
  67. steps:
  68. - uses: actions/checkout@v4
  69. with:
  70. # just fetching 1 commit is not enough for setuptools-scm, so we fetch all
  71. fetch-depth: 0
  72. - name: Set up Python ${{ matrix.python-version }}
  73. uses: actions/setup-python@v5
  74. with:
  75. python-version: ${{ matrix.python-version }}
  76. - name: Cache pip
  77. uses: actions/cache@v4
  78. with:
  79. path: ~/.cache/pip
  80. key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
  81. restore-keys: |
  82. ${{ runner.os }}-pip-
  83. ${{ runner.os }}-
  84. - name: Install Linux packages
  85. if: ${{ runner.os == 'Linux' }}
  86. run: |
  87. sudo apt-get update
  88. sudo apt-get install -y libssl-dev libacl1-dev liblz4-dev libzstd-dev pkg-config build-essential
  89. sudo apt-get install -y libxxhash-dev || true
  90. sudo apt-get install -y libfuse-dev fuse || true # Required for Python llfuse module
  91. sudo apt-get install -y libfuse3-dev fuse3 || true # Required for Python pyfuse3 module
  92. - name: Install macOS packages
  93. if: ${{ runner.os == 'macOS' }}
  94. run: brew bundle install
  95. - name: Install Python requirements
  96. run: |
  97. python -m pip install --upgrade pip setuptools wheel
  98. pip install -r requirements.d/development.txt
  99. - name: Install borgbackup
  100. env:
  101. # we already have that in the global env, but something is broken and overwrites that.
  102. # so, set it here, again.
  103. PKG_CONFIG_PATH: "/opt/homebrew/opt/openssl@3.0/lib/pkgconfig:$PKG_CONFIG_PATH"
  104. run: |
  105. pip install -ve .
  106. - name: run pytest via tox
  107. env:
  108. # we already have that in the global env, but something is broken and overwrites that.
  109. # so, set it here, again.
  110. PKG_CONFIG_PATH: "/opt/homebrew/opt/openssl@3.0/lib/pkgconfig:$PKG_CONFIG_PATH"
  111. run: |
  112. # do not use fakeroot, but run as root. avoids the dreaded EISDIR sporadic failures. see #2482.
  113. #sudo -E bash -c "tox -e py"
  114. tox --skip-missing-interpreters
  115. - name: Upload coverage to Codecov
  116. uses: codecov/codecov-action@v4
  117. env:
  118. OS: ${{ runner.os }}
  119. python: ${{ matrix.python-version }}
  120. with:
  121. token: ${{ secrets.CODECOV_TOKEN }}
  122. env_vars: OS, python