-
Notifications
You must be signed in to change notification settings - Fork 6
86 lines (83 loc) · 2.21 KB
/
test.yaml
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
name: 'Testing package'
on:
pull_request:
jobs:
py-lint:
strategy:
matrix:
cmd:
- black
- isort
- ruff
- mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Run lint check
uses: pre-commit/[email protected]
with:
extra_args: -a ${{ matrix.cmd }}
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true
- name: Check code format
run: cargo fmt -- --check --config use_try_shorthand=true,imports_granularity=Crate
clippy:
permissions:
checks: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -p psqlpy --all-features -- -W clippy::all -W clippy::pedantic -D warnings
pytest:
name: ${{matrix.job.os}}-${{matrix.py_version}}
strategy:
matrix:
py_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
job:
- os: ubuntu-latest
ssl_cmd: sudo apt-get update && sudo apt-get install libssl-dev openssl
runs-on: ${{matrix.job.os}}
steps:
- uses: actions/checkout@v1
- name: Setup Postgres
uses: ./.github/actions/setup_postgres/
with:
username: postgres
password: postgres
database: psqlpy_test
ssl_on: "on"
id: postgres
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- name: Setup OpenSSL
run: ${{matrix.job.ssl_cmd}}
- name: Setup python for test ${{ matrix.py_version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py_version }}
- name: Install tox
run: pip install "tox-gh>=1.2,<2"
- name: Run pytest
run: tox -v -c tox.ini