-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (39 loc) · 1.29 KB
/
pull.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: pull request lint and test
on:
pull_request:
env:
PYTHON_VERSION: "graalpy-24"
permissions:
contents: read
concurrency:
group: ${{ github.head_ref || github.run_id }}-${{ github.actor || github.repository_owner }}
cancel-in-progress: false
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"
- name: Cache pip dependencies
if: ${{ github.actor == github.repository_owner }}
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ env.PYTHON_VERSION }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics
- name: Run tests
if: false # TODO no unittests for now
run: |
pytest