From 8556c3ba3d47d5f760b20e4c24f29b3d74c4464e Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 16 Oct 2024 11:58:48 -0400 Subject: [PATCH] build: add presubmits for unit tests in golden files (#2224) --- .github/sync-repo-settings.yaml | 1 + .github/workflows/tests.yaml | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index e04213881..f90c27a52 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -50,6 +50,7 @@ branchProtectionRules: - 'integration' - 'goldens-lint' - 'goldens-prerelease' + - 'goldens-unit' - 'style-check' - 'snippetgen' - 'unit (3.7)' diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5eaf75d2a..dbaed7f9a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -328,6 +328,27 @@ jobs: nox -f tests/integration/goldens/eventarc/noxfile.py -s mypy-3.12 blacken lint nox -f tests/integration/goldens/logging/noxfile.py -s mypy-3.12 blacken lint nox -f tests/integration/goldens/redis/noxfile.py -s mypy-3.12 blacken lint + goldens-unit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: 'pip' + - name: Install nox. + run: | + python -m pip install nox + - name: Run the `unit` nox session + # Exclude testing for asset which requires dependency google-cloud-org-policy + # in order to run unit tests + # See https://github.com/googleapis/gapic-generator-python/issues/1806 + run: | + nox -f tests/integration/goldens/credentials/noxfile.py -s unit-3.12 + nox -f tests/integration/goldens/eventarc/noxfile.py -s unit-3.12 + nox -f tests/integration/goldens/logging/noxfile.py -s unit-3.12 + nox -f tests/integration/goldens/redis/noxfile.py -s unit-3.12 goldens-prerelease: runs-on: ubuntu-latest steps: