|
87 | 87 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_CHECK }} |
88 | 88 | if: always() |
89 | 89 |
|
90 | | - test: |
| 90 | + test-sqlite: |
| 91 | + name: Test SQLite |
| 92 | + needs: lint |
| 93 | + runs-on: ubuntu-latest |
| 94 | + steps: |
| 95 | + - name: Checkout repository |
| 96 | + uses: actions/checkout@v4 |
| 97 | + |
| 98 | + - name: Cache virtualenv |
| 99 | + uses: actions/cache@v4 |
| 100 | + with: |
| 101 | + path: .venv |
| 102 | + key: ${{ runner.os }}-python-uv-venv-${{ github.sha }} |
| 103 | + restore-keys: | |
| 104 | + ${{ runner.os }}-python-uv-venv- |
| 105 | +
|
| 106 | + - name: Run pytest |
| 107 | + run: | |
| 108 | + source .venv/bin/activate |
| 109 | + make test |
| 110 | +
|
| 111 | + - name: Upload test results to Codecov |
| 112 | + uses: codecov/test-results-action@v1 |
| 113 | + with: |
| 114 | + flags: sqlite |
| 115 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 116 | + |
| 117 | + - name: Upload results to Codecov |
| 118 | + uses: codecov/codecov-action@v5 |
| 119 | + with: |
| 120 | + flags: sqlite |
| 121 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 122 | + |
| 123 | + - name: Slack webhook |
| 124 | + uses: 8398a7/action-slack@v3 |
| 125 | + with: |
| 126 | + status: ${{ job.status }} |
| 127 | + author_name: fastapi-cookbook |
| 128 | + fields: repo,message,commit,author,action,eventName,ref,workflow,job,took |
| 129 | + if_mention: failure,cancelled |
| 130 | + env: |
| 131 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_CHECK }} |
| 132 | + if: always() |
| 133 | + |
| 134 | + test-mysql: |
91 | 135 | env: |
92 | 136 | DB_ROOT: "password" |
93 | 137 | DB_TYPE: "mysql" |
@@ -117,8 +161,8 @@ jobs: |
117 | 161 | --health-timeout=5s |
118 | 162 | --health-retries=3 |
119 | 163 |
|
120 | | - name: Test |
121 | | - needs: setup |
| 164 | + name: Test MySQL |
| 165 | + needs: lint |
122 | 166 | runs-on: ubuntu-latest |
123 | 167 | steps: |
124 | 168 | - name: Checkout repository |
@@ -146,11 +190,13 @@ jobs: |
146 | 190 | - name: Upload test results to Codecov |
147 | 191 | uses: codecov/test-results-action@v1 |
148 | 192 | with: |
| 193 | + flags: mysql |
149 | 194 | token: ${{ secrets.CODECOV_TOKEN }} |
150 | 195 |
|
151 | 196 | - name: Upload results to Codecov |
152 | 197 | uses: codecov/codecov-action@v5 |
153 | 198 | with: |
| 199 | + flags: mysql |
154 | 200 | token: ${{ secrets.CODECOV_TOKEN }} |
155 | 201 |
|
156 | 202 | - name: Slack webhook |
|
0 commit comments