ci.yml 3.8 KB

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