Skip to content

Commit 77f17ec

Browse files
authored
Modify GitHub Actions for Python and Rust integration
Updated Python workflow to use ruff for linting and added Rust setup.
1 parent bd1fa38 commit 77f17ec

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/python-app.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: microbiorust-py python tests
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
paths:
10+
- 'microbiorust-py/**'
11+
pull_request:
12+
branches: [ "main" ]
13+
paths:
14+
- 'microbiorust-py/**'
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
build:
21+
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Set up Python 3.10
27+
uses: actions/setup-python@v3
28+
with:
29+
python-version: "3.10"
30+
cache: 'pip'
31+
32+
- name: Set up Rust
33+
uses: dtolnay/rust-toolchain@stable
34+
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install maturin ruff pytest
39+
pip install ./microbiorust-py
40+
41+
- name: Lint with ruff
42+
run: |
43+
# stop the build for critical errors (E9, F63, F7, F82 equivalents)
44+
ruff check microbiorust-py/ --select E9,F63,F7,F82 --output-format=full
45+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
46+
ruff check microbiorust-py/ --exit-zero --max-complexity=10 --line-length=127
47+
48+
- name: Test with pytest
49+
run: |
50+
pytest -v microbiorust-py/tests/

0 commit comments

Comments
 (0)