forked from mvnmgrx/kiutils
-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (52 loc) · 1.63 KB
/
python-test.yml
File metadata and controls
62 lines (52 loc) · 1.63 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
59
60
61
62
name: Python Unittests
on:
workflow_dispatch:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
python-unittest:
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.13", "3.12", "3.11", "3.10", "3.9", "3.8"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements_dev.txt
- name: Check code formatting with Black
run: |
black --check .
- name: Build and install kiutils on Windows
if: matrix.os == 'windows-latest'
run: |
python -m build
$whl = Get-ChildItem -Path dist -Recurse -Filter "*.whl" | Select-Object -First 1
python -m pip install $whl.FullName
shell: pwsh
- name: Build and install kiutils on Unix & macOS
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
python -m build
WHL_FILE=$(ls dist | grep none-any.whl | head -n 1)
python -m pip install dist/$WHL_FILE
- name: Run unittests
run: |
mkdir -p reports
python3 test.py
python3 -m unittest
- name: Upload test report
uses: actions/upload-artifact@v4
with:
name: test-report-${{ matrix.os }}-${{ matrix.python-version }}
path: reports