ci.yml 4.0 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. - '**.cfg'
  13. - '**.ini'
  14. - 'requirements.d/*'
  15. - '!docs/**'
  16. pull_request:
  17. branches: [ 1.4-maint ]
  18. paths:
  19. - '**.py'
  20. - '**.pyx'
  21. - '**.c'
  22. - '**.h'
  23. - '**.yml'
  24. - '**.cfg'
  25. - '**.ini'
  26. - 'requirements.d/*'
  27. - '!docs/**'
  28. jobs:
  29. lint:
  30. runs-on: ubuntu-22.04
  31. timeout-minutes: 2
  32. steps:
  33. - uses: actions/checkout@v3
  34. - uses: chartboost/ruff-action@v1
  35. pytest:
  36. needs: lint
  37. strategy:
  38. fail-fast: false
  39. matrix:
  40. include:
  41. - os: ubuntu-20.04
  42. python-version: '3.9'
  43. toxenv: py39-fuse2
  44. - os: ubuntu-20.04
  45. python-version: '3.10'
  46. toxenv: py310-fuse3
  47. - os: ubuntu-20.04
  48. python-version: '3.11'
  49. toxenv: py311-fuse2
  50. - os: ubuntu-22.04
  51. python-version: '3.12'
  52. toxenv: py312-fuse3
  53. - os: macos-12
  54. python-version: '3.9'
  55. toxenv: py39-none # note: no fuse testing, due to #6099, see also #6196.
  56. env:
  57. # Configure pkg-config to use OpenSSL from Homebrew
  58. PKG_CONFIG_PATH: "/usr/local/opt/openssl@1.1/lib/pkgconfig:$PKG_CONFIG_PATH"
  59. TOXENV: ${{ matrix.toxenv }}
  60. runs-on: ${{ matrix.os }}
  61. timeout-minutes: 90
  62. steps:
  63. - uses: actions/checkout@v3
  64. with:
  65. # just fetching 1 commit is not enough for setuptools-scm, so we fetch all
  66. fetch-depth: 0
  67. - name: Set up Python ${{ matrix.python-version }}
  68. uses: actions/setup-python@v4
  69. with:
  70. python-version: ${{ matrix.python-version }}
  71. - name: Cache pip
  72. uses: actions/cache@v3
  73. with:
  74. path: ~/.cache/pip
  75. key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
  76. restore-keys: |
  77. ${{ runner.os }}-pip-
  78. ${{ runner.os }}-
  79. - name: Install Linux packages
  80. if: ${{ runner.os == 'Linux' }}
  81. run: |
  82. sudo apt-get update
  83. sudo apt-get install -y libssl-dev libacl1-dev liblz4-dev libzstd-dev pkg-config build-essential
  84. sudo apt-get install -y libxxhash-dev || true
  85. sudo apt-get install -y libb2-dev || true
  86. sudo apt-get install -y libfuse-dev fuse || true # Required for Python llfuse module
  87. sudo apt-get install -y libfuse3-dev fuse3 || true # Required for Python pyfuse3 module
  88. - name: Install macOS packages
  89. if: ${{ runner.os == 'macOS' }}
  90. run: |
  91. brew install pkg-config || brew upgrade pkg-config
  92. brew install zstd || brew upgrade zstd
  93. brew install lz4 || brew upgrade lz4
  94. brew install openssl@1.1 || brew upgrade openssl@1.1
  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: "/usr/local/opt/openssl@1.1/lib/pkgconfig:$PKG_CONFIG_PATH"
  104. run: |
  105. pip install -e .
  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: "/usr/local/opt/openssl@1.1/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@v1
  117. env:
  118. OS: ${{ runner.os }}
  119. python: ${{ matrix.python-version }}
  120. with:
  121. token: ${{ secrets.CODECOV_TOKEN }}
  122. env_vars: OS, python