-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (48 loc) · 1.44 KB
/
pytest.yml
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
name: Run Tests and Check Formatting
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.11']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Linux/macOS - Install dependencies
- name: Install dependencies (Linux/macOS)
if: runner.os != 'Windows' # Only run on Linux/macOS
env:
PYTHONIOENCODING: utf-8 # Ensure Python uses UTF-8 encoding
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test]
shell: bash
# Windows - Install dependencies
- name: Install dependencies (Windows)
if: runner.os == 'Windows' # Only run on Windows
env:
PYTHONIOENCODING: utf-8 # Ensure Python uses UTF-8 encoding
PYTHONUTF8: 1 # Force Python to use UTF-8 mode
run: |
chcp 65001 # Change code page to UTF-8
python -m pip install --upgrade pip setuptools
python -m pip install -e .[test]
shell: pwsh
- name: Code formatting
run: |
pip install "black[jupyter]==24.4.2"
black --check .
- name: Test with pytest
run: |
pytest --color=yes