2
0

ci.yml 4.0 KB

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