Skip to content

Commit 4e4651c

Browse files
authored
Setup PR validator with GitHub actions (#1)
1 parent defcec5 commit 4e4651c

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Build Validation
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.10", "3.11"]
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install flake8 pytest
31+
pip install -r requirements.txt
32+
- name: Lint with flake8
33+
run: |
34+
# flake8 settings are in setup.cfg
35+
flake8 . --count --show-source --statistics --exit-zero
36+
- name: Test with pytest
37+
run: |
38+
# pytest markers are defined in setup.cfg
39+
pytest -m "not e2e" --verbose

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Durable Task Client SDK for Python
22

33
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4+
[![Build Validation](https://github.com/microsoft/durabletask-python/actions/workflows/pr-validation.yml/badge.svg)](https://github.com/microsoft/durabletask-python/actions/workflows/pr-validation.yml)
45

56
This repo contains a Python client SDK for use with the [Durable Task Framework for Go](https://github.com/microsoft/durabletask-go) and [Dapr Workflow](https://docs.dapr.io/developing-applications/building-blocks/workflow/workflow-overview/). With this SDK, you can define, schedule, and manage durable orchestrations using ordinary Python code.
67

@@ -12,7 +13,7 @@ This repo contains a Python client SDK for use with the [Durable Task Framework
1213

1314
### Prerequisites
1415

15-
- Python 3.8 or higher
16+
- Python 3.10 or higher
1617

1718
### Installing
1819

@@ -32,13 +33,24 @@ If the gRPC proto definitions need to be updated, the corresponding source code
3233
python3 -m grpc_tools.protoc --proto_path=./submodules/durabletask-protobuf/protos --python_out=./durabletask/protos --pyi_out=./durabletask/protos --grpc_python_out=./durabletask/protos orchestrator_service.proto
3334
```
3435

36+
### Linting and running unit tests
37+
38+
See the [pr-validation.yml](.github/workflows/pr-validation.yml) workflow for the full list of commands that are run as part of the CI/CD pipeline.
39+
3540
### Running E2E tests
41+
3642
The E2E (end-to-end) tests require a sidecar process to be running. You can run a sidecar process using the following `docker` command (assumes you have Docker installed on your local system.)
3743

3844
```sh
3945
docker run --name durabletask-sidecar -p 4001:4001 --env 'DURABLETASK_SIDECAR_LOGLEVEL=Debug' --rm cgillum/durabletask-sidecar:latest start --backend Emulator
4046
```
4147

48+
To run the E2E tests, run the following command from the project root (we assume you have `pytest` installed locally):
49+
50+
```sh
51+
pytest -m e2e --verbose
52+
```
53+
4254
## Contributing
4355

4456
This project welcomes contributions and suggestions. Most contributions require you to agree to a

0 commit comments

Comments
 (0)