-
Notifications
You must be signed in to change notification settings - Fork 3
89 lines (74 loc) · 2.59 KB
/
check-python.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
on:
push:
paths:
- 'python/**/*'
- .github/workflows/check-python.yml
pull_request:
paths:
- 'python/**/*'
- .github/workflows/check-python.yml
name: "Python checks"
permissions:
contents: read
jobs:
check:
if: "! contains(github.event.head_commit.message, '[ci skip]')"
timeout-minutes: 5
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (Python ${{ matrix.config.python }})
strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, python: '3.7' }
- {os: ubuntu-latest, python: '3.8' }
- {os: ubuntu-latest, python: '3.9' }
- {os: ubuntu-latest, python: '3.10' }
- {os: ubuntu-latest, python: '3.11' }
- {os: ubuntu-latest, python: '3.12' }
- {os: macOS-latest, python: '3.11' }
- {os: windows-latest, python: '3.11' }
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.config.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install port4me
run: |
cd python/
pip install .
- name: Session information
run: |
python -c "import os; print('EUID='+str(os.geteuid()))"
python --version
python -m port4me --version
- name: Test with pytest
run: |
pip install pytest
pytest
- name: Check CLI
if: runner.os != 'Windows'
run: |
curl -L -O https://github.com/bats-core/bats-core/archive/refs/tags/v1.10.0.tar.gz && tar xf v1.10.0.tar.gz
curl -L -O https://github.com/bats-core/bats-support/archive/refs/tags/v0.3.0.tar.gz && tar xf v0.3.0.tar.gz
curl -L -O https://github.com/bats-core/bats-assert/archive/refs/tags/v2.1.0.tar.gz && tar xf v2.1.0.tar.gz
export BATS_SUPPORT_HOME=$PWD/bats-support-0.3.0
export BATS_ASSERT_HOME=$PWD/bats-assert-2.1.0
export PATH=$PWD/bats-core-1.10.0/bin:$PATH
bash --version
bats --version
cd python/
make check-cli
- name: Lint with flake8
run: |
pip install flake8
cd python/
flake8 --version
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics