-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (73 loc) · 2.53 KB
/
pr.yml
File metadata and controls
76 lines (73 loc) · 2.53 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
name: Test
"on": [pull_request, workflow_dispatch]
jobs:
test:
if: "! contains(toJSON(github.event.head_commit.message), ':memo: Update CHANGELOG.md')"
name: Python ${{ matrix.python-version }} tests
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: make poetry-download
- name: Set up cache
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: make install
- name: Install dependencies ci
run: poetry run pip install pytest-github-actions-annotate-failures
- name: Run tests
run: make test
lint:
if: "! contains(toJSON(github.event.head_commit.message), ':memo: Update CHANGELOG.md')"
name: Python lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install poetry
run: make poetry-download
- name: Set up cache
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: make install
- name: Run tests
run: make lint apiclient_pydantic
dependabot-auto-merge:
name: Dependabot auto-merge
runs-on: ubuntu-latest
needs: [test, lint]
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
permissions:
contents: write
pull-requests: write
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.2.1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' }}
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}