ci.yml 4.2 KB

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