-
-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (48 loc) · 1.61 KB
/
on_push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Build and test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.11]
steps:
- uses: actions/checkout@v4
- name: Cargo Build
run: cargo build
- name: Cargo Tests
run: cargo test
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 ./python_client --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 ./python_client --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
- name: Lint with mypy
run: |
pip install mypy
pip install types-requests
mypy python_client/throttle_client
- name: Test Python Client
run: |
export THROTTLE_LOG=debug
pip install -e .[test]
pytest -v
dependabot:
needs: [test]
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- name: Merge Depenabot Pull Request
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}