ENH: Update Pub/Sub mocks to deal with combined question/answer topics #2231
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions. | |
# | |
# On successful test, the package will be published. For candidate releases, the package will be | |
# published to test.pypi.org server (to ensure the process works). For merges to master, the | |
# package will be published live. | |
name: python-ci | |
on: | |
push: | |
branches-ignore: | |
- main | |
jobs: | |
check-semantic-version: | |
if: "!contains(github.event.head_commit.message, 'skipci')" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: octue/[email protected] | |
with: | |
path: pyproject.toml | |
breaking_change_indicated_by: minor | |
run-tests: | |
if: "!contains(github.event.head_commit.message, 'skipci')" | |
runs-on: ${{ matrix.os }} | |
env: | |
USING_COVERAGE: "3.9" | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
uses: snok/[email protected] | |
- name: Check pyproject.toml file | |
run: poetry check | |
- name: Install tox | |
run: pip install tox | |
- name: Authenticate with Google Cloud | |
id: auth | |
uses: google-github-actions/[email protected] | |
with: | |
# NOTE: If setting create_credentials_file=true, .dockerignore file must include `gha-creds-*.json` to avoid baking these credentials into build | |
create_credentials_file: true | |
workload_identity_provider: "projects/437801218871/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider" | |
service_account: "[email protected]" | |
- name: Run tests | |
env: | |
TEST_PROJECT_NAME: ${{ secrets.TEST_PROJECT_NAME }} | |
GOOGLE_CLOUD_PROJECT: ${{ secrets.TEST_PROJECT_NAME }} | |
run: tox -vv -e py | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: coverage.xml | |
fail_ci_if_error: true | |
test-publish: | |
if: "!contains(github.event.head_commit.message, 'skipci')" | |
runs-on: ubuntu-latest | |
needs: [check-semantic-version, run-tests] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Test package is publishable with PyPI test server | |
uses: JRubics/[email protected] | |
with: | |
python_version: "3.9" | |
pypi_token: ${{ secrets.TEST_PYPI_TOKEN }} | |
repository_name: "testpypi" | |
repository_url: "https://test.pypi.org/legacy/" | |
ignore_dev_requirements: "yes" |