Add $(python,...) built-in #205
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, conformance tests, and | |
| # example scripts. | |
| target: | |
| - 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: Install GNU toolchain (macOS) | |
| # v6.18 kernel Kconfig probes require GNU Make >= 4.0 and a | |
| # supported linker (GNU ld or LLD). macOS ships Make 3.81 | |
| # and Apple ld, neither of which is compatible. | |
| # We add ld.lld to PATH and set LD=ld.lld; reltest forwards LD | |
| # as a make command-line variable to override the kernel | |
| # Makefile's unconditional LD=$(CROSS_COMPILE)ld assignment. | |
| if: ${{ matrix.target.os == 'macOS' }} | |
| run: | | |
| brew install make lld | |
| echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH | |
| echo "$(brew --prefix lld)/bin" >> $GITHUB_PATH | |
| echo "LD=ld.lld" >> $GITHUB_ENV | |
| - 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: v6.18 | |
| - 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 | |
| working-directory: ${{ matrix.target.headless-only && '.' || 'Kconfiglib' }} | |
| run: | | |
| if [ "${{ matrix.target.headless-only }}" == "true" ]; then | |
| # Windows: portable subset -- excludes tests that need gcc or | |
| # Unix shell commands (Kpreprocess uses $(shell,...) with | |
| # bash-specific syntax). | |
| python -m pytest tests/test_preprocess.py -v --tb=short \ | |
| -k "test_user_defined or test_success_failure or test_python_fn or test_kconfig_warn" | |
| else | |
| python -m pytest tests/ -v --tb=short --ignore=tests/test_conformance.py | |
| fi | |
| - 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: Build kernel C kconfig tools | |
| if: ${{ matrix.target.headless-only != true }} | |
| run: | | |
| ${MAKE:-make} -j"$(getconf _NPROCESSORS_ONLN)" ARCH=x86 ${LD:+LD=$LD} allnoconfig | |
| test -x scripts/kconfig/conf | |
| rm -f .config .config.old | |
| - name: Run conformance 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 |