-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.2 KB
/
python-package.yml
File metadata and controls
44 lines (40 loc) · 1.2 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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package test
on:
push:
branches:
- feature/py*
pull_request:
branches:
- feature/py*
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# python-version: ["3.7","3.8"]
python-version: ["3.8","3.9", "3.10", "3.11","3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
cache: true
cache-dependency-path: './py/pdm.lock'
- name: Install dependencies
run: |
cd py
pdm sync -d -G "lint,test"
- name: Lint with flake8
run: |
cd py
pdm run flake8 . --select=E9,F63,F7,F82 --show-source
pdm run flake8 . --exit-zero
- name: Test with pytest
run: |
cd py
pdm run python -m unittest discover