-
Notifications
You must be signed in to change notification settings - Fork 14
95 lines (75 loc) · 2.28 KB
/
pr_gate.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: PR Gate
# We are calling the api when running the tests
# Therefore we need a PAT to authenticate
# We also need to wait between testing the different python version to avoid rate limiting
# This is why we cannot use the matrix to run the tests in parallel
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
tags:
description: 'Tags to label this manual run (optional)'
default: 'Manual run'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test Python on ubuntu-22.04
runs-on: ubuntu-22.04
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create Secrets Directory
run: mkdir -p ./secrets
- name: Set up Local Environment File
run: echo '{"token":"${{ secrets.GH_PAT }}"}' > ./secrets/pat.json
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies for Python 3.9
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests for Python 3.9
run: |
python -m pytest tests -v
env:
PYTHONPATH: ${{ github.workspace }}
- name: Sleep for 60 seconds
run: sleep 60
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies for Python 3.10
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests for Python 3.10
run: |
python -m pytest tests -v
env:
PYTHONPATH: ${{ github.workspace }}
- name: Sleep for 60 seconds
run: sleep 60
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies for Python 3.11
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests for Python 3.11
run: |
python -m pytest tests -v
env:
PYTHONPATH: ${{ github.workspace }}