Repository navigation
58 lines (48 loc) · 1.67 KB
/
Copy pathpython-app.yml
File metadata and controls
58 lines (48 loc) · 1.67 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
53
54
55
56
57
58
# 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
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and Test (Python)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python 3.12
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
cache: 'pip'
cache-dependency-path: 'microbiorust-py/pyproject.toml'
- name: Set up Rust stable
run: rustup toolchain install 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