-
-
Notifications
You must be signed in to change notification settings - Fork 12
52 lines (42 loc) · 1.42 KB
/
Copy pathpython-app.yml
File metadata and controls
52 lines (42 loc) · 1.42 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
# This workflow installs Python dependencies, runs tests and lints with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: microbiorust-py python tests
on:
push:
branches: [ "main" ]
paths:
- 'microbiorust-py/**'
pull_request:
branches: [ "main" ]
paths:
- 'microbiorust-py/**'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: 'pip'
cache-dependency-path: 'microbiorust-py/pyproject.toml'
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install maturin ruff pytest
pip install ./microbiorust-py
- name: Lint with ruff
run: |
# stop the build for critical errors (E9, F63, F7, F82 equivalents)
ruff check microbiorust-py/ --select E9,F63,F7,F82 --output-format=full
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
ruff check microbiorust-py/ --exit-zero --line-length=127
- name: Test with pytest
run: |
pytest -v
working-directory: microbiorust-py/tests