Repository navigation
111 lines (95 loc) · 3.47 KB
/
Copy pathtest.yml
File metadata and controls
111 lines (95 loc) · 3.47 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Test
on: [push, pull_request]
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (Python ${{ matrix.target.python }}, ${{ matrix.target.os }})
runs-on: ${{ matrix.target.builder }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
# NOTE: Windows runs only headless tests (no kernel tree, no Unix
# shell). Linux/macOS run selftests, compatibility tests, and
# example scripts.
target:
# Python 3.12
- python: '3.12'
os: Linux
builder: ubuntu-24.04
- python: '3.12'
os: macOS
builder: macos-15
- python: '3.12'
os: Windows
builder: windows-2022
headless-only: true
steps:
- name: Set up environment
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
# Disable file name validation on Windows because Linux source tree
# contains potentially problematic file names.
git config --global core.protectNTFS false
fi
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.target.python }}
- name: Check Python version
run: |
set -x
python --version
pip --version
python -c "import platform; print(platform.architecture())"
- name: Install Python dependencies
run: |
python -m pip install --user setuptools wheel pytest
- name: Check out Linux source code
# Skip for Windows (headless-only mode)
if: ${{ matrix.target.headless-only != true }}
uses: actions/checkout@v6
with:
repository: torvalds/linux
ref: v5.4
- name: Check out Kconfiglib source code
uses: actions/checkout@v6
with:
# Windows (headless-only): checkout to root directory
# Linux/macOS (full test): checkout to Kconfiglib subdirectory
path: ${{ matrix.target.headless-only && '.' || 'Kconfiglib' }}
- name: Run pytest selftests
# Skip on Windows: several tests depend on Unix shell ($(shell,...)),
# gcc, and forward-slash paths that are unavailable on Windows CI.
if: ${{ matrix.target.headless-only != true }}
working-directory: ${{ matrix.target.headless-only && '.' || 'Kconfiglib' }}
run: |
python -m pytest tests/ -v --tb=short --ignore=tests/test_compat.py
- name: Apply Linux Kconfig Makefile patch
# Skip for Windows (headless-only mode)
if: ${{ matrix.target.headless-only != true }}
run: |
git apply Kconfiglib/makefile.patch
- name: Run compatibility tests and example scripts
# Skip for Windows (headless-only mode)
if: ${{ matrix.target.headless-only != true }}
run: |
Kconfiglib/tests/reltest python
- name: Validate rawterm and menuconfig (Unix)
# Exercises rawterm Color/Style/Region compositing, terminal init/close
# (termios on Unix), and menuconfig headless mode with style parsing.
if: ${{ matrix.target.os != 'Windows' }}
working-directory: Kconfiglib
run: |
python .ci/validate-rawterm.py
- name: Validate rawterm and menuconfig (Windows)
# On Windows, use cmd so Python gets real console handles (bash
# runs through MSYS2/mintty which lacks a native Windows console).
if: ${{ matrix.target.os == 'Windows' }}
shell: cmd
run: |
python .ci/validate-rawterm.py