diff --git a/synthtool/gcp/templates/python_library/.github/workflows/docs.yml b/synthtool/gcp/templates/python_library/.github/workflows/docs.yml new file mode 100644 index 000000000..42ab9d477 --- /dev/null +++ b/synthtool/gcp/templates/python_library/.github/workflows/docs.yml @@ -0,0 +1,38 @@ +on: + pull_request: + branches: + - main +name: docs +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "{{ unit_test_python_versions | last }}" + - 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: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "{{ unit_test_python_versions | last }}" + - 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/synthtool/gcp/templates/python_library/.github/workflows/lint.yml b/synthtool/gcp/templates/python_library/.github/workflows/lint.yml new file mode 100644 index 000000000..b3960d68b --- /dev/null +++ b/synthtool/gcp/templates/python_library/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +on: + pull_request: + branches: + - main +name: lint +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "{{ unit_test_python_versions | last }}" + - 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 diff --git a/synthtool/gcp/templates/python_library/.github/workflows/unittest.yml b/synthtool/gcp/templates/python_library/.github/workflows/unittest.yml new file mode 100644 index 000000000..57d4aa422 --- /dev/null +++ b/synthtool/gcp/templates/python_library/.github/workflows/unittest.yml @@ -0,0 +1,57 @@ +on: + pull_request: + branches: + - main +name: unittest +jobs: + unit: + runs-on: ubuntu-latest + strategy: + matrix: + python: {{unit_test_python_versions}} + 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.python {{ '}}' }} + run: | + nox -s unit-${{ '{{' }} matrix.python {{ '}}' }} + - name: Upload coverage results + uses: actions/upload-artifact@v2 + with: + name: coverage-artifacts + path: .coverage-${{ '{{' }} matrix.python {{ '}}' }} + + cover: + runs-on: ubuntu-latest + needs: + - unit + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "{{ unit_test_python_versions | last }}" + - 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* + coverage report --show-missing --fail-under=100