Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #6

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/psm-interop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: PSM Interop

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
unittest:
# By default, only version is printed out in parens, e.g. "unittest (3.10)"
# This changes it to "unittest (python3.10)"
name: "unittest (python${{ matrix.python_version }})"
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ["3.9", "3.10", "3.11"]
fail-fast: false
permissions:
pull-requests: read # Used by paths-filter to read the diff.
contents: read
defaults:
run:
working-directory: './'

steps:
- uses: actions/checkout@v4

# To add this job to required GitHub checks, it's not enough to use
# the on.pull_request.paths filter. For required checks, the job needs to
# return the success status, and not be skipped.
# Using paths-filter action, we skip the setup/test steps when psm interop
# files are unchanged, and the job returns success.
- uses: dorny/paths-filter@v2
id: paths_filter
with:
filters: |
psm_interop_src:
- './**'
- './protos/empty.proto'
- './protos/messages.proto'
- './protos/test.proto'

- uses: actions/setup-python@v4
if: ${{ steps.paths_filter.outputs.psm_interop_src == 'true' }}
with:
python-version: "${{ matrix.python_version }}"
cache: 'pip'
cache-dependency-path: './requirements.lock'

- name: "Install requirements"
if: ${{ steps.paths_filter.outputs.psm_interop_src == 'true' }}
run: |
pip list
pip install --upgrade pip setuptools
pip list
pip install -r requirements.lock
pip list

- name: "Generate protos"
if: ${{ steps.paths_filter.outputs.psm_interop_src == 'true' }}
run: >
python -m grpc_tools.protoc --proto_path=.
--python_out=. --grpc_python_out=.
protos/empty.proto
protos/messages.proto
protos/test.proto

- name: "Run unit tests"
if: ${{ steps.paths_filter.outputs.psm_interop_src == 'true' }}
run: python -m tests.unit
Loading