|
| 1 | +name: Quality control checks |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ 8.x ] |
| 6 | + paths-ignore: |
| 7 | + - '**.md' # Do not need to run CI for markdown changes. |
| 8 | + pull_request: |
| 9 | + branches: [ 8.x ] |
| 10 | + paths-ignore: |
| 11 | + - '**.md' |
| 12 | + |
| 13 | +jobs: |
| 14 | + linux: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] |
| 20 | + |
| 21 | + services: |
| 22 | + redis: |
| 23 | + image: redis |
| 24 | + ports: |
| 25 | + - 6379:6379 |
| 26 | + dynamodb: |
| 27 | + image: amazon/dynamodb-local |
| 28 | + ports: |
| 29 | + - 8000:8000 |
| 30 | + consul: |
| 31 | + image: hashicorp/consul |
| 32 | + ports: |
| 33 | + - 8500:8500 |
| 34 | + |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + - name: Set up Python ${{ matrix.python-version }} |
| 38 | + uses: actions/setup-python@v4 |
| 39 | + with: |
| 40 | + python-version: ${{ matrix.python-version }} |
| 41 | + |
| 42 | + - name: Install requirements |
| 43 | + run: | |
| 44 | + pipx install virtualenv |
| 45 | + pip install -r test-requirements.txt |
| 46 | + pip install -r test-filesource-optional-requirements.txt |
| 47 | + pip install -r consul-requirements.txt |
| 48 | + python setup.py install |
| 49 | + pip freeze |
| 50 | +
|
| 51 | + - name: Run tests |
| 52 | + run: pytest -s testing -W error::SyntaxWarning |
| 53 | + |
| 54 | + - name: Test packaging |
| 55 | + run: | |
| 56 | + sudo rm -rf dist *.egg-info |
| 57 | + ./test-packaging/test-packaging.sh |
| 58 | +
|
| 59 | + - name: Verify typehints |
| 60 | + run: make lint |
| 61 | + |
| 62 | + - name: Verify docs can be successfully built |
| 63 | + run: make docs |
| 64 | + |
| 65 | + - name: build SSE contract test service |
| 66 | + if: ${{ matrix.python-version != 3.7 }} |
| 67 | + run: | |
| 68 | + cd sse-contract-tests |
| 69 | + make build-test-service |
| 70 | +
|
| 71 | + - name: start SSE contract test service |
| 72 | + if: ${{ matrix.python-version != 3.7 }} |
| 73 | + run: | |
| 74 | + cd sse-contract-tests |
| 75 | + make start-test-service & |
| 76 | +
|
| 77 | + - name: run SSE contract tests |
| 78 | + if: ${{ matrix.python-version != 3.7 }} |
| 79 | + run: | |
| 80 | + cd sse-contract-tests |
| 81 | + make run-contract-tests |
| 82 | +
|
| 83 | + - name: Build contract tests |
| 84 | + if: ${{ matrix.python-version != 3.7 }} |
| 85 | + run: make build-contract-tests |
| 86 | + |
| 87 | + - name: Start contract test service |
| 88 | + if: ${{ matrix.python-version != 3.7 }} |
| 89 | + run: make start-contract-test-service & |
| 90 | + |
| 91 | + - name: run contract tests |
| 92 | + if: ${{ matrix.python-version != 3.7 }} |
| 93 | + run: make run-contract-tests |
| 94 | + |
| 95 | + windows: |
| 96 | + runs-on: windows-latest |
| 97 | + |
| 98 | + defaults: |
| 99 | + run: |
| 100 | + shell: powershell |
| 101 | + |
| 102 | + strategy: |
| 103 | + matrix: |
| 104 | + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] |
| 105 | + |
| 106 | + steps: |
| 107 | + - uses: actions/checkout@v4 |
| 108 | + - name: Set up Python ${{ matrix.python-version }} |
| 109 | + uses: actions/setup-python@v4 |
| 110 | + with: |
| 111 | + python-version: ${{ matrix.python-version }} |
| 112 | + |
| 113 | + - name: Setup DynamoDB |
| 114 | + run: | |
| 115 | + $ProgressPreference = "SilentlyContinue" |
| 116 | + iwr -outf dynamo.zip https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip |
| 117 | + mkdir dynamo |
| 118 | + Expand-Archive -Path dynamo.zip -DestinationPath dynamo |
| 119 | + cd dynamo |
| 120 | + cmd /c "START /b java -Djava.library.path=./DynamoDBLocal_lib -jar ./DynamoDBLocal.jar" |
| 121 | +
|
| 122 | + - name: Setup Consul |
| 123 | + run: | |
| 124 | + $ProgressPreference = "SilentlyContinue" |
| 125 | + iwr -outf consul.zip https://releases.hashicorp.com/consul/1.4.2/consul_1.4.2_windows_amd64.zip |
| 126 | + mkdir consul |
| 127 | + Expand-Archive -Path consul.zip -DestinationPath consul |
| 128 | + cd consul |
| 129 | + sc.exe create "Consul" binPath="$(Get-Location)/consul.exe agent -dev" |
| 130 | + sc.exe start "Consul" |
| 131 | +
|
| 132 | + - name: Setup Redis |
| 133 | + run: | |
| 134 | + $ProgressPreference = "SilentlyContinue" |
| 135 | + iwr -outf redis.zip https://github.com/MicrosoftArchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.zip |
| 136 | + mkdir redis |
| 137 | + Expand-Archive -Path redis.zip -DestinationPath redis |
| 138 | + cd redis |
| 139 | + ./redis-server --service-install |
| 140 | + ./redis-server --service-start |
| 141 | + Start-Sleep -s 5 |
| 142 | + ./redis-cli ping |
| 143 | +
|
| 144 | + - name: Install requirements |
| 145 | + run: | |
| 146 | + pip install -r test-requirements.txt |
| 147 | + pip install -r test-filesource-optional-requirements.txt |
| 148 | + pip install -r consul-requirements.txt |
| 149 | + python setup.py install |
| 150 | + pip freeze |
| 151 | +
|
| 152 | + - name: Run tests |
| 153 | + run: pytest -s testing -W error::SyntaxWarning |
0 commit comments