|
9 | 9 | firebaseToolsVersion:
|
10 | 10 | gradleInfoLog:
|
11 | 11 | type: boolean
|
| 12 | + pythonVersion: |
12 | 13 | pull_request:
|
13 | 14 | paths:
|
14 | 15 | - .github/workflows/dataconnect.yml
|
|
27 | 28 | FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '13.29.1' }}
|
28 | 29 | FDC_FIREBASE_TOOLS_DIR: /tmp/firebase-tools
|
29 | 30 | FDC_FIREBASE_COMMAND: /tmp/firebase-tools/node_modules/.bin/firebase
|
| 31 | + FDC_PYTHON_VERSION: ${{ inputs.pythonVersion || '3.13' }} |
30 | 32 |
|
31 | 33 | concurrency:
|
32 | 34 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
@@ -256,30 +258,122 @@ jobs:
|
256 | 258 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
257 | 259 | with:
|
258 | 260 | show-progress: false
|
| 261 | + sparse-checkout: '.github/' |
259 | 262 | - uses: docker://rhysd/actionlint:1.7.7
|
260 | 263 | with:
|
261 | 264 | args: -color /github/workspace/.github/workflows/dataconnect.yml
|
262 | 265 |
|
| 266 | + python-ci-unit-tests: |
| 267 | + continue-on-error: false |
| 268 | + runs-on: ubuntu-latest |
| 269 | + steps: |
| 270 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 271 | + with: |
| 272 | + show-progress: false |
| 273 | + sparse-checkout: 'firebase-dataconnect/ci/' |
| 274 | + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 |
| 275 | + with: |
| 276 | + python-version: ${{ env.FDC_PYTHON_VERSION }} |
| 277 | + - run: pip install -r firebase-dataconnect/ci/requirements.txt |
| 278 | + - name: pytest |
| 279 | + working-directory: firebase-dataconnect/ci |
| 280 | + run: pytest --verbose --full-trace --color=no --strict-config |
| 281 | + |
| 282 | + python-ci-lint: |
| 283 | + continue-on-error: false |
| 284 | + runs-on: ubuntu-latest |
| 285 | + steps: |
| 286 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 287 | + with: |
| 288 | + show-progress: false |
| 289 | + sparse-checkout: 'firebase-dataconnect/ci/' |
| 290 | + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 |
| 291 | + with: |
| 292 | + python-version: ${{ env.FDC_PYTHON_VERSION }} |
| 293 | + - run: pip install -r firebase-dataconnect/ci/requirements.txt |
| 294 | + - name: ruff check |
| 295 | + working-directory: firebase-dataconnect/ci |
| 296 | + run: ruff check --diff --verbose --no-cache --output-format=github --exit-non-zero-on-fix |
| 297 | + |
| 298 | + python-ci-format: |
| 299 | + continue-on-error: false |
| 300 | + runs-on: ubuntu-latest |
| 301 | + steps: |
| 302 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 303 | + with: |
| 304 | + show-progress: false |
| 305 | + sparse-checkout: 'firebase-dataconnect/ci/' |
| 306 | + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 |
| 307 | + with: |
| 308 | + python-version: ${{ env.FDC_PYTHON_VERSION }} |
| 309 | + - run: pip install -r firebase-dataconnect/ci/requirements.txt |
| 310 | + - name: ruff format |
| 311 | + working-directory: firebase-dataconnect/ci |
| 312 | + run: ruff format --diff --verbose --no-cache |
| 313 | + |
| 314 | + python-ci-type-check: |
| 315 | + continue-on-error: false |
| 316 | + runs-on: ubuntu-latest |
| 317 | + steps: |
| 318 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 319 | + with: |
| 320 | + show-progress: false |
| 321 | + sparse-checkout: 'firebase-dataconnect/ci/' |
| 322 | + - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 |
| 323 | + with: |
| 324 | + python-version: ${{ env.FDC_PYTHON_VERSION }} |
| 325 | + - run: pip install -r firebase-dataconnect/ci/requirements.txt |
| 326 | + - name: pyright |
| 327 | + working-directory: firebase-dataconnect/ci |
| 328 | + run: pyright --warnings --stats |
| 329 | + |
| 330 | + # The "send-notifications" job adds a comment to GitHub Issue |
| 331 | + # https://github.com/firebase/firebase-android-sdk/issues/6857 with the results of the scheduled |
| 332 | + # nightly runs. Interested parties can then subscribe to that issue to be aprised of the outcome |
| 333 | + # of the nightly runs. |
| 334 | + # |
| 335 | + # When testing the comment-adding logic itself, you can add the line |
| 336 | + # trksmnkncd_notification_issue=6863 |
| 337 | + # into the PR's description to instead post a comment to issue #6863, an issue specifically |
| 338 | + # created for testing, avoiding spamming the main issue to which others are subscribed. |
263 | 339 | send-notifications:
|
264 |
| - needs: [integration-test, actionlint-dataconnect-yml] |
| 340 | + needs: |
| 341 | + - 'integration-test' |
| 342 | + - 'actionlint-dataconnect-yml' |
| 343 | + - 'python-ci-unit-tests' |
| 344 | + - 'python-ci-lint' |
| 345 | + - 'python-ci-format' |
| 346 | + - 'python-ci-type-check' |
265 | 347 | if: always()
|
266 | 348 | permissions:
|
267 | 349 | issues: write
|
268 | 350 | runs-on: ubuntu-latest
|
269 | 351 | steps:
|
270 |
| - - name: Post Comment on Issue #6857 |
271 |
| - if: github.event_name == 'schedule' |
272 |
| - env: |
273 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
274 |
| - run: | |
275 |
| - set -euo pipefail |
| 352 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 353 | + with: |
| 354 | + show-progress: false |
| 355 | + sparse-checkout: | |
| 356 | + firebase-dataconnect/ci/ |
| 357 | + .github/ |
| 358 | +
|
| 359 | + - name: gh auth login |
| 360 | + run: echo '${{ secrets.GITHUB_TOKEN }}' | gh auth login --with-token |
276 | 361 |
|
277 |
| - cat >message.txt <<EOF |
278 |
| - Result of workflow ${{ github.workflow }} at ${{ github.ref }}: ${{ job.status }} |
279 |
| - ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} |
280 |
| - job=${{ github.job }} run_id=${{ github.run_id }} run_number=${{ github.run_number }} run_attempt=${{ github.run_attempt }} |
| 362 | + - name: Create Job Results File |
| 363 | + id: create-job-results-file |
| 364 | + run: | |
| 365 | + set -xveuo pipefail |
| 366 | + cat >'${{ runner.temp }}/job_results.txt' <<EOF |
| 367 | + integration-test:${{ needs.integration-test.result }} |
| 368 | + actionlint-dataconnect-yml:${{ needs.actionlint-dataconnect-yml.result }} |
| 369 | + python-ci-unit-tests:${{ needs.python-ci-unit-tests.result }} |
| 370 | + python-ci-lint:${{ needs.python-ci-lint.result }} |
| 371 | + python-ci-format:${{ needs.python-ci-format.result }} |
| 372 | + python-ci-type-check:${{ needs.python-ci-type-check.result }} |
281 | 373 | EOF
|
282 | 374 |
|
283 |
| - echo "Posting comment on GitHub Issue: https://github.com/firebase/firebase-android-sdk/issues/6857:" |
284 |
| - cat message.txt |
285 |
| - gh issue comment 6857 --body-file message.txt -R ${{ github.repository }} |
| 375 | + - uses: ./.github/actions/dataconnect-send-notifications |
| 376 | + with: |
| 377 | + python-version: ${{ env.FDC_PYTHON_VERSION }} |
| 378 | + github-issue-for-scheduled-runs: "6857" |
| 379 | + job-results-file: ${{ runner.temp }}/job_results.txt |
0 commit comments