forked from purplegrapeZz/goroutine-py
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.29 KB
/
python-package.yml
File metadata and controls
46 lines (38 loc) · 1.29 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
# .github/workflows/python-package.yml
name: CI
on:
push:
branches: [ "master", "main" ] # Also works on 'main' branch
pull_request:
branches: [ "master", "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"] # Adjusted for modern versions
steps:
- name: Checkout code
uses: actions/checkout@v4 # Use the latest version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5 # Use the latest version
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# This command installs the project from local files in editable mode (-e)
# and includes the [test] dependencies from pyproject.toml
python -m pip install -e ".[test]"
- name: Lint with flake8, black, and isort
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Check formatting with black
black --check .
# Check import sorting with isort
isort --check .
- name: Run tests with pytest
run: |
pytest