From b697440240205a25599a06ecf4691585394eacf9 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 17 Jan 2022 15:00:43 +0000 Subject: [PATCH 1/4] chore: move docs check from kokoro to GH actions --- .github/sync-repo-settings.yaml | 1 + .github/workflows/docs.yml | 25 ++++++++++ .github/workflows/lint.yml | 30 ++++++++++++ .../{unittest_lint.yml => unittest.yml} | 47 +------------------ 4 files changed, 57 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/lint.yml rename .github/workflows/{unittest_lint.yml => unittest.yml} (76%) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 67fcd59f..db2ddd08 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -23,6 +23,7 @@ branchProtectionRules: - 'unit_wo_grpc-3.6' - 'unit_wo_grpc-3.10' - 'cover' + - 'docs' permissionRules: - team: actools-python permission: admin diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..bd90e5bf --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,25 @@ +name: "Docs" + +on: + pull_request: + branches: + - main +jobs: + run-docs: + name: docs + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.7" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run docs + run: | + nox -s docs docfx + diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..01deab55 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,30 @@ +name: "Unit tests" + +on: + pull_request: + branches: + - main +jobs: + run-lint-mypy: + name: lint-mypy + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.7" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run lint + run: | + nox -s lint + - name: Run lint_setup_py + run: | + nox -s lint_setup_py + - name: Run mypy + run: | + nox -s mypy diff --git a/.github/workflows/unittest_lint.yml b/.github/workflows/unittest.yml similarity index 76% rename from .github/workflows/unittest_lint.yml rename to .github/workflows/unittest.yml index 302be970..9ab0c395 100644 --- a/.github/workflows/unittest_lint.yml +++ b/.github/workflows/unittest.yml @@ -1,44 +1,11 @@ -name: "Lint / Unit tests / Cover / Mypy" +name: "Unit tests" on: pull_request: branches: - main - jobs: - - run-lint-mypy: - name: lint-mypy - runs-on: ubuntu-latest - - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - - name: Install nox - run: | - python -m pip install --upgrade setuptools pip wheel - python -m pip install nox - - - name: Run lint - run: | - nox -s lint - - - name: Run lint_setup_py - run: | - nox -s lint_setup_py - - - name: Run mypy - run: | - nox -s mypy - run-unittests: name: unit${{ matrix.option }}-${{ matrix.python }} runs-on: ubuntu-latest @@ -58,28 +25,22 @@ jobs: python: 3.8 - option: "_wo_grpc" python: 3.9 - steps: - - name: Checkout uses: actions/checkout@v2 - - name: Setup Python uses: actions/setup-python@v2 with: python-version: ${{ matrix.python }} - - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel python -m pip install nox - - name: Run unit tests env: COVERAGE_FILE: .coverage${{ matrix.option }}-${{matrix.python }} run: | nox -s unit${{ matrix.option }}-${{ matrix.python }} - - name: Upload coverage results uses: actions/upload-artifact@v2 with: @@ -91,28 +52,22 @@ jobs: runs-on: ubuntu-latest needs: - run-unittests - steps: - - name: Checkout uses: actions/checkout@v2 - - name: Setup Python uses: actions/setup-python@v2 with: python-version: "3.10" - - name: Install coverage run: | python -m pip install --upgrade setuptools pip wheel python -m pip install coverage - - name: Download coverage results uses: actions/download-artifact@v2 with: name: coverage-artifacts path: .coverage-results/ - - name: Report coverage results run: | coverage combine .coverage-results/.coverage* From 8048011137b927bb2b6efef581708205f88fd2a1 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 17 Jan 2022 15:02:55 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .github/release-please.yml | 1 - .kokoro/release.sh | 2 +- .kokoro/release/common.cfg | 12 +----------- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/release-please.yml b/.github/release-please.yml index 466597e5..4507ad05 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,2 +1 @@ releaseType: python -handleGHRelease: true diff --git a/.kokoro/release.sh b/.kokoro/release.sh index a00f93ec..0728ce11 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -26,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools export PYTHONUNBUFFERED=1 # Move into the package, build the distribution and upload. -TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") +TWINE_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secret_manager/google-cloud-pypi-token") cd github/python-api-core python3 setup.py sdist bdist_wheel twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index de4f6f89..586e7649 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -23,18 +23,8 @@ env_vars: { value: "github/python-api-core/.kokoro/release.sh" } -# Fetch PyPI password -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "google-cloud-pypi-token-keystore-1" - } - } -} - # Tokens needed to report release status back to GitHub env_vars: { key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem,google-cloud-pypi-token" } From 916b0634a0878655952245e106fbf3373961cbab Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 17 Jan 2022 15:04:43 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .github/release-please.yml | 1 + .kokoro/release.sh | 2 +- .kokoro/release/common.cfg | 12 +++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/release-please.yml b/.github/release-please.yml index 4507ad05..466597e5 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1 +1,2 @@ releaseType: python +handleGHRelease: true diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 0728ce11..a00f93ec 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -26,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools export PYTHONUNBUFFERED=1 # Move into the package, build the distribution and upload. -TWINE_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secret_manager/google-cloud-pypi-token") +TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") cd github/python-api-core python3 setup.py sdist bdist_wheel twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index 586e7649..de4f6f89 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -23,8 +23,18 @@ env_vars: { value: "github/python-api-core/.kokoro/release.sh" } +# Fetch PyPI password +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "google-cloud-pypi-token-keystore-1" + } + } +} + # Tokens needed to report release status back to GitHub env_vars: { key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem,google-cloud-pypi-token" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" } From 727ed3fe4d392305b168fe2ffd33a09f36775500 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Mon, 17 Jan 2022 16:46:55 +0000 Subject: [PATCH 4/4] fix typo --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 01deab55..c6d94b00 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: "Unit tests" +name: "Lint" on: pull_request: