ci.yml 3.6 KB

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