From 8d5bac7fd55f25e96694160a58f2a26002a1c9bf Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 22 Jan 2022 06:22:28 -0500 Subject: [PATCH] ci(python): run lint / unit tests / docs as GH actions (#155) Source-Link: https://github.com/googleapis/synthtool/commit/57be0cdb0b94e1669cee0ca38d790de1dfdbcd44 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ed1f9983d5a935a89fe8085e8bb97d94e41015252c5b6c9771257cf8624367e6 Co-authored-by: Owl Bot --- .../.github/.OwlBot.lock.yaml | 15 ++++++++++- .../.github/workflows/docs.yml | 27 ++++++++++++++----- .../.github/workflows/lint.yml | 9 +++---- .../.github/workflows/unittest.yml | 25 ++++++----------- 4 files changed, 45 insertions(+), 31 deletions(-) diff --git a/packages/google-cloud-access-approval/.github/.OwlBot.lock.yaml b/packages/google-cloud-access-approval/.github/.OwlBot.lock.yaml index eecb84c21b27..8cb43804d999 100644 --- a/packages/google-cloud-access-approval/.github/.OwlBot.lock.yaml +++ b/packages/google-cloud-access-approval/.github/.OwlBot.lock.yaml @@ -1,3 +1,16 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:ae600f36b6bc972b368367b6f83a1d91ec2c82a4a116b383d67d547c56fe6de3 + digest: sha256:ed1f9983d5a935a89fe8085e8bb97d94e41015252c5b6c9771257cf8624367e6 diff --git a/packages/google-cloud-access-approval/.github/workflows/docs.yml b/packages/google-cloud-access-approval/.github/workflows/docs.yml index 1c1fb099ff1c..f7b8344c4500 100644 --- a/packages/google-cloud-access-approval/.github/workflows/docs.yml +++ b/packages/google-cloud-access-approval/.github/workflows/docs.yml @@ -1,13 +1,10 @@ -name: "Docs" - on: pull_request: branches: - main - +name: docs jobs: - run-docs: - name: docs + docs: runs-on: ubuntu-latest steps: - name: Checkout @@ -15,11 +12,27 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: "3.8" + python-version: "3.10" - 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 + nox -s docs + docfx: + 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 docfx + run: | + nox -s docfx diff --git a/packages/google-cloud-access-approval/.github/workflows/lint.yml b/packages/google-cloud-access-approval/.github/workflows/lint.yml index 4fbcc0daf6b9..1e8b05c3d7ff 100644 --- a/packages/google-cloud-access-approval/.github/workflows/lint.yml +++ b/packages/google-cloud-access-approval/.github/workflows/lint.yml @@ -1,13 +1,10 @@ -name: "Lint" - on: pull_request: branches: - main - +name: lint jobs: - run-lint: - name: lint + lint: runs-on: ubuntu-latest steps: - name: Checkout @@ -15,7 +12,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: "3.8" + python-version: "3.10" - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel diff --git a/packages/google-cloud-access-approval/.github/workflows/unittest.yml b/packages/google-cloud-access-approval/.github/workflows/unittest.yml index 873a8fbaa685..074ee2504ca5 100644 --- a/packages/google-cloud-access-approval/.github/workflows/unittest.yml +++ b/packages/google-cloud-access-approval/.github/workflows/unittest.yml @@ -1,22 +1,14 @@ -name: "Unit tests" - on: pull_request: branches: - main - +name: unittest jobs: - run-unittests: - name: unit-${{ matrix.python }} + unit: runs-on: ubuntu-latest strategy: matrix: - python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" - - "3.10" + python: ['3.6', '3.7', '3.8', '3.9', '3.10'] steps: - name: Checkout uses: actions/checkout@v2 @@ -30,20 +22,19 @@ jobs: python -m pip install nox - name: Run unit tests env: - COVERAGE_FILE: .coverage${{ matrix.option }}-${{matrix.python }} + COVERAGE_FILE: .coverage-${{ matrix.python }} run: | - nox -s unit${{ matrix.option }}-${{ matrix.python }} + nox -s unit-${{ matrix.python }} - name: Upload coverage results uses: actions/upload-artifact@v2 with: name: coverage-artifacts - path: .coverage${{ matrix.option }}-${{ matrix.python }} + path: .coverage-${{ matrix.python }} - report-coverage: - name: cover + cover: runs-on: ubuntu-latest needs: - - run-unittests + - unit steps: - name: Checkout uses: actions/checkout@v2