|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths-ignore: |
| 6 | + - 'docs/**' |
| 7 | + - '**/*.rst' |
| 8 | + - '**/*.md' |
| 9 | + branches: |
| 10 | + - master |
| 11 | + - '[0-9].[0-9]' |
| 12 | + pull_request: |
| 13 | + branches: |
| 14 | + - master |
| 15 | + - '[0-9].[0-9]' |
| 16 | + |
| 17 | +jobs: |
| 18 | + |
| 19 | + lint: |
| 20 | + name: Code linters |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + - name: install python |
| 25 | + uses: actions/setup-python@v3 |
| 26 | + with: |
| 27 | + python-version: 3.9 |
| 28 | + cache: 'pip' |
| 29 | + - name: run code linters |
| 30 | + run: | |
| 31 | + pip install -r dev_requirements.txt |
| 32 | + invoke linters |
| 33 | +
|
| 34 | + run-tests: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + timeout-minutes: 30 |
| 37 | + strategy: |
| 38 | + max-parallel: 15 |
| 39 | + matrix: |
| 40 | + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7'] |
| 41 | + test-type: ['standalone', 'cluster'] |
| 42 | + connection-type: ['hiredis', 'plain'] |
| 43 | + env: |
| 44 | + ACTIONS_ALLOW_UNSECURE_COMMANDS: true |
| 45 | + name: Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v2 |
| 48 | + - name: install python |
| 49 | + uses: actions/setup-python@v3 |
| 50 | + with: |
| 51 | + python-version: ${{ matrix.python-version }} |
| 52 | + cache: 'pip' |
| 53 | + - name: run tests |
| 54 | + run: | |
| 55 | + pip install -U setuptools wheel |
| 56 | + pip install -r dev_requirements.txt |
| 57 | + tox -e ${{matrix.test-type}}-${{matrix.connection-type}} |
| 58 | + - name: Upload codecov coverage |
| 59 | + uses: codecov/codecov-action@v2 |
| 60 | + with: |
| 61 | + fail_ci_if_error: false |
| 62 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 63 | + |
| 64 | + build_and_test_package: |
| 65 | + name: Validate building and installing the package |
| 66 | + runs-on: ubuntu-latest |
| 67 | + strategy: |
| 68 | + matrix: |
| 69 | + extension: ['tar.gz', 'whl'] |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v2 |
| 72 | + - name: install python |
| 73 | + uses: actions/setup-python@v3 |
| 74 | + with: |
| 75 | + python-version: 3.9 |
| 76 | + - name: Run installed unit tests |
| 77 | + run: | |
| 78 | + bash .github/workflows/install_and_test.sh ${{ matrix.extension }} |
| 79 | +
|
| 80 | + install_package_from_commit: |
| 81 | + name: Install package from commit hash |
| 82 | + runs-on: ubuntu-latest |
| 83 | + strategy: |
| 84 | + matrix: |
| 85 | + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7'] |
| 86 | + steps: |
| 87 | + - uses: actions/checkout@v2 |
| 88 | + - name: install python ${{ matrix.python-version }} |
| 89 | + uses: actions/setup-python@v3 |
| 90 | + with: |
| 91 | + python-version: ${{ matrix.python-version }} |
| 92 | + cache: 'pip' |
| 93 | + - name: install from pip |
| 94 | + run: | |
| 95 | + pip install --quiet git+${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git@${GITHUB_SHA} |
0 commit comments